udp, datagram sockets

Jean-Paul Calderone exarkun at divmod.com
Mon Aug 6 13:05:07 EDT 2007


On Mon, 06 Aug 2007 09:03:45 -0700, 7stud <bbxx789_05ss at yahoo.com> wrote:
>I'm trying to understand datagrams.  My client program sends a message
>to the server, and then the server infinitely loops over the recv() to
>make sure all the data was received.  I'm trying to use an * to signal
>the end of the message, so that the server can break out of the
>infinite while loop used to check the recv().  However, my server
>repeatedly outputs the client message over and over again.  Can anyone
>tell me why?

The network is probably dropping some of your data, causing the server
to never see the termination marker.  UDP is difficult to use effectively.
Fortunately, TCP is suitable for many applications.  You should consider
using it, instead.

Jean-Paul



More information about the Python-list mailing list