![]() |
| | #1 |
| Registered User Join Date: Dec 2004 Location: Brazil, Porto Alegre
Posts: 152
| UDP programming . Any link or response is much appreciated!1) Can I send and receive using the same socket in multithread? Must I use semaphores? 2) If two hosts send something at the same time, both the datagrams will be sent, or they will be dropped? I know that UDP is a little unreliable, but can this kind of error occur, or Ethernet protocol deals with it? Again, thanks any help. |
| Mortissus is offline | |
| | #2 | |
| Registered User Join Date: Jan 2005
Posts: 847
| Quote:
| |
| Quantum1024 is offline | |
| | #3 |
| Registered User Join Date: Dec 2004
Posts: 95
| To the first question: You don't need external synchronization just to send() and recv() in multiple threads on the same socket, but you'll likely sync. some at some point. |
| azteched is offline | |
| | #4 |
| Registered User Join Date: Dec 2004 Location: Brazil, Porto Alegre
Posts: 152
| Thanks for the answer! I will try to better explain the second question. Is UDP safe against collision (physical level)? I need to know what kind of errors can I have with UDP, that I do not have with TCP, besides datagrams dropped and arriving out of order. What I must consider when programming UDP, that I do not need to worry with TCP. As always, thanks any kind of help. |
| Mortissus is offline | |
| | #5 |
| Registered User Join Date: Jan 2005
Posts: 847
| Other then datagrams ariving out of order and being dropped they can be corupted or duplicated. If both hosts send a datagram they wont collide, the router(s) will still foreward both allthoug neither is guaranteed to arive and each host may not receive the others datagram at EXACLY the same time. |
| Quantum1024 is offline | |
| | #6 |
| Registered User Join Date: Dec 2004 Location: Brazil, Porto Alegre
Posts: 152
| Ok! Thanks very much! |
| Mortissus is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with UDP | AlexS | C# Programming | 0 | 07-07-2009 06:21 PM |
| simultaneously waiting for data on FIFO and UDP using select call | yogesh3073 | Networking/Device Communication | 2 | 01-05-2007 09:53 AM |
| C++ Builder UDP programming | Hankyaku | Networking/Device Communication | 5 | 09-17-2005 08:41 AM |
| Traceroute using UDP and ICMP | Unregistered | C++ Programming | 1 | 08-09-2002 07:09 PM |
| Traceroute using UDP + ICMP | Unregistered | Windows Programming | 0 | 08-05-2002 10:50 AM |