Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » UDP sockets?
UDP sockets? [message #23742] Wed, 18 November 2009 18:26 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

As it is stated in U++ help topics, it doesn't currently support UDP sockets. But I'd like to ask if it needs big effort to add UDP support into U++?
Re: UDP sockets? [message #23749 is a reply to message #23742] Thu, 19 November 2009 10:35 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i donno what "udp socket" you refer to. but i am using it.
socket() i suppose. do U need a more powerful class?
Re: UDP sockets? [message #23757 is a reply to message #23749] Thu, 19 November 2009 17:55 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Please show how you create UDP socket in U++. It is more likely TCP/IP socket.
Re: UDP sockets? [message #23761 is a reply to message #23757] Fri, 20 November 2009 02:41 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);

my whole project is EZ Comm on http://ezproject.sourceforge.net
It supports both TCP & UDP.
Re: UDP sockets? [message #23767 is a reply to message #23761] Fri, 20 November 2009 10:42 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Mindtraveller wrote on Thu, 19 November 2009 19:55

Please show how you create UDP socket in U++.

bonami wrote on Fri, 20 November 2009 04:41

socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);



There is no such socket constructor in U++. We have only
	Socket() {}
	Socket(One<Data> data) : data(data) {}

Re: UDP sockets? [message #23770 is a reply to message #23767] Fri, 20 November 2009 13:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Fri, 20 November 2009 04:42

Mindtraveller wrote on Thu, 19 November 2009 19:55

Please show how you create UDP socket in U++.

bonami wrote on Fri, 20 November 2009 04:41

socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);



There is no such socket constructor in U++. We have only
	Socket() {}
	Socket(One<Data> data) : data(data) {}




That is true. But it appears that encapsulating UDP sockets really has little sense. But I might be wrong.

BTW, I have a nice thing called "Urr", which stands for "UDP request-response", which is package that implements UDP based request-response (both Strings) proprietary protocol (adding realiability and allowing messages of any size to pass).

Maybe it could be useful for you? I was considering adding this public sources for a while...

Maybe I will put it into bazaar.

Mirek
Re: UDP sockets? [message #23771 is a reply to message #23770] Fri, 20 November 2009 13:42 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
luzr wrote on Fri, 20 November 2009 14:37

adding realiability

While I love reliability, UDP is by definition not reliable. I think any steps taken beyond a simple timeout would negate the benefits of it. Even the timeout is for some practical purposes overkill Smile.
Re: UDP sockets? [message #23773 is a reply to message #23771] Fri, 20 November 2009 14:13 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 20 November 2009 07:42

luzr wrote on Fri, 20 November 2009 14:37

adding realiability

While I love reliability, UDP is by definition not reliable. I think any steps taken beyond a simple timeout would negate the benefits of it. Even the timeout is for some practical purposes overkill Smile.



I guess it is more sophisticated than that.

For both requests and response <8KB, if there is no lost packet, there are only 2 datagrams going through with Urr (one to server, one from it). So no efficiency is lost.

Anyway, it happily handles all possible issues like lost or duplicated or long packets.
Previous Topic: request: Socket working example
Next Topic: MT.cpp __thread sMain related CRASH in VB6 project
Goto Forum:
  


Current Time: Thu Mar 28 16:52:03 CET 2024

Total time taken to generate the page: 0.01213 seconds