[Tutor] Python and sockets

cecilwesterhof at xs4all.nl cecilwesterhof at xs4all.nl
Tue Aug 17 14:43:48 CEST 2004


I started with python and also with sockets. I wrote a little program to
start using sockets. In principle it works okay. There are only two
problems:

- When I open a socket and it is refused by the server, I just get a
socket back, without a signal that the server refused the connection. What
do I need to do, to see that the connection is refused?

- When I close a socket that has no data waiting, everything works fine.
But when I close a socket that still has data to be read. The socket is
closed, but the server never sees that it is closed. I tried using
shutdown, but this did not change anything. What do I need to do, so that
the server sees the close?

Does anybody have a good resource for python and sockets?





More information about the Tutor mailing list