Pekka Pessi Pekka.Pessi at
Sat Jun 2 18:04:39 EDT 2001

In message <3B193770.30999EAC at> Adonis <deltapigz at> writes:
>how can i check for errors when using the socket module?
>errors like: unable to connect; insufficient memory etc.

        Usually, you get an exception indicating the error.  If you are
        using sockets in nonblocking mode, you can also check errors
        explicitly with getsockopt() method, e.g.,

                error = s.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)

                                        Pekka Pessi

More information about the Python-list mailing list