Understanding when UPD fails
Hi, I'm pretty new in network programming, and I have to understand how can I know if and UDP send fails and how ca I recover the message sent (if it is very importanat). Some code will be very useful for me. I use winsock, but I should understand also UNIX-dependent code ... bye ;)
You don't.
Generally people get around that limitation by storing messages sent until the recipient returns some sort of verification. If the verification is not recieved in a certain amount of time, the send is assumed failed, and the message resent.
Generally people get around that limitation by storing messages sent until the recipient returns some sort of verification. If the verification is not recieved in a certain amount of time, the send is assumed failed, and the message resent.
Ok...
So I should verify that all the data has been sent looking (for instance) at the last bytes to see if them correctly refers to what I need?
Can I have some simple pseudo-code for starting?
Another question: someone told me that I should use TCP for chatting and for authentication, so I'm sure that the whole mssage is recived correctly ... but in this way I have to store a TCP socket for every client, losing a lot of resources then using UDP ... right?
So I should verify that all the data has been sent looking (for instance) at the last bytes to see if them correctly refers to what I need?
Can I have some simple pseudo-code for starting?
Another question: someone told me that I should use TCP for chatting and for authentication, so I'm sure that the whole mssage is recived correctly ... but in this way I have to store a TCP socket for every client, losing a lot of resources then using UDP ... right?
Don't know. I just use TCP for everything. Adding an extra socket for each client is going to be far less resources than keeping a list of un-ack'd UDP messages...
Personally, I've never understood the facination with UDP around here.
Personally, I've never understood the facination with UDP around here.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement