Hi,

I have received your code and looking at it.
I cannot reproduce the packet loss on localhost.
I can reproduce on different computers, but I found a flaw in your design: remember TWSocket use non blocking. SendTo will fail if winsock is not able to receive data and you don't check that condition.
Here is how I found the problem:
procedure TForm1.OnTimer(aSender:TObject);
begin
 if fWS.State=wsConnected then
 begin
   move(fCounter,fData^,4);
if fWS.SendTo(fPeerSrc,fPeerSrcLen,fData,fDataSize) = fDataSize then <==== test changed
   begin
     inc(fCounter);
     inc(fBR,fDataSize);
   end
   else
ShowMessage('send failed'); <============ message displayed
   Restart;
 end;
end;

You can't call SendTo as fast as you like when the socket is using async mode.
Before sending, you should check if the event OnDataSent has been triggered.
I'm not sure you correctly checked with wireshark that all packets where sent actually because their aren't when SendTo fails.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be



----- Original Message ----- From: "emanuele bizzarri" <e.bizza...@e-works.it>
To: <twsocket@elists.org>
Sent: Sunday, February 27, 2011 7:05 PM
Subject: Re: [twsocket] udp packet loss


Hi,
now I've made a console application for the UDP server, but nothing changes.
I see packet loss inside application, but all packets are correctly
captured by wireshark.

Thankyou,
Emanuele

Il 27/02/2011 15.09, Francois PIETTE ha scritto:
My client/server project size is only 12KB, is it possible to attach it
to the mail? Someone could try it...

It don't primize, but you may send the source code to me (no executable
please) I will try to test it. Include complete projects so that I can
test within a few minutes, and instructions to reproduce the issue.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to