Problems with sending UPD Packets over sendto
-
Hi @ all, under XP I have the problem sending UDP Packets over the sendto command. Sporadically my client didn´t send the packets. The first time it works fine. I build the packet and then send it with the sendto command. On the second time or more the packet will be created and runs the send command correct. The Remote Port and Address are correct too. But if I protocol these actions with packetyzer or wireshark the sent packet is not displayed anywhere. Anyone here who knows what it could be that the packet will not send? Regards, Karsten
-
Hi @ all, under XP I have the problem sending UDP Packets over the sendto command. Sporadically my client didn´t send the packets. The first time it works fine. I build the packet and then send it with the sendto command. On the second time or more the packet will be created and runs the send command correct. The Remote Port and Address are correct too. But if I protocol these actions with packetyzer or wireshark the sent packet is not displayed anywhere. Anyone here who knows what it could be that the packet will not send? Regards, Karsten
Check the return value of sendto API
-
Hi @ all, under XP I have the problem sending UDP Packets over the sendto command. Sporadically my client didn´t send the packets. The first time it works fine. I build the packet and then send it with the sendto command. On the second time or more the packet will be created and runs the send command correct. The Remote Port and Address are correct too. But if I protocol these actions with packetyzer or wireshark the sent packet is not displayed anywhere. Anyone here who knows what it could be that the packet will not send? Regards, Karsten
UDP will drop packets if you send them too fast - here's a Microsoft article that says as much[^]. Fundamentally, UDP makes no delivery guarantees, so if that's important to you, you either want to think about using TCP (that'd be my choice) or implementing some form of handshaking. I would recommend downloading the IBM TCP/IP Redbook[^] - it's a very useful networking resource.
-
Check the return value of sendto API
-
UDP will drop packets if you send them too fast - here's a Microsoft article that says as much[^]. Fundamentally, UDP makes no delivery guarantees, so if that's important to you, you either want to think about using TCP (that'd be my choice) or implementing some form of handshaking. I would recommend downloading the IBM TCP/IP Redbook[^] - it's a very useful networking resource.
-
But under Vista it works correctly. And I send SIP Packets above the UDP Socket. I can´t use TCP because it´s a realtime ip phone I programm.
CrazyDogg wrote:
But under Vista it works correctly.
Which means it's likely a coincidence.
CrazyDogg wrote:
I can´t use TCP because it´s a realtime ip phone I programm.
Then it'll be up to you to code the handshaking.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
CrazyDogg wrote:
But under Vista it works correctly.
Which means it's likely a coincidence.
CrazyDogg wrote:
I can´t use TCP because it´s a realtime ip phone I programm.
Then it'll be up to you to code the handshaking.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
CrazyDogg wrote:
How to code a handshaking for this?
However you want to. It's just extra information (usually a CRC) that the send adds to the packet at a specific location (e.g., front, back). The receiver looks at that spot to know if all of the packet has been received. If so, an ACK of some sort is sent back.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
CrazyDogg wrote:
How to code a handshaking for this?
However you want to. It's just extra information (usually a CRC) that the send adds to the packet at a specific location (e.g., front, back). The receiver looks at that spot to know if all of the packet has been received. If so, an ACK of some sort is sent back.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch