I've a problem with udp.
Often my application detects packet losses.

At first glance, this is expected with UDP. By construction UDP is an unreliable transport.

In order to systematically reproduce the problem, I've used the
following configuration.
I use 2 pc connected with a cross cable.
The client sends udp numbered packets to the server.
Packet size is 1460. One packet is sent every 1 ms (about 11 Mbps).

I use wireshark to analyze the traffic on the server machine.
I see that all the packets arrive on the server, but not inside the
application.

Packet loss increases if I resize the form, so I've made a worker thread
in order to manage udp server socket messages, but the problem remains.

This is "normal". If the application is not able to read UDP packets as fast as packets are incomming, they are simply dropped. There is no flow control with UDP. This is how UDP is working.

Have you any suggestion to resolve this problem?

The easiest way is to use TCP which is a reliable protocol, with flow control, retries and everything needed to make it reliable.

Maybe the socket configuration should be changed?

Won't change anything.
If you still want to use UDP, you may use a dedicated thread to handle communication and give it a high priority so that it will receive CPU before the user interface.


I attach the code of server, client and worker thread:

Sorry no time to read your code. i just browsed quickly and see you don't create TWSocket in thread's execute method, so all events are handled by the main thread. This is a flaw in your design, at least.

--
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