Sockets

Oleg Broytmann phd at phd.fep.ru
Sat Jun 2 16:02:54 EDT 2001


On Sat, 2 Jun 2001, Adonis wrote:
> *newbie question*
>
> how can i check for errors when using the socket module?

   In Python, most errors reported through exceptions. Read tutorial,
especially on raising and catching exceptions.

> errors like: unable to connect; insufficient memory etc.

   But sockets (in Python) have one specially ugly feature - sometimes they
hang without timeout. Use select(), or non-blocking sockets, or download
timeoutsocket from http://www.timo-tasi.org/python/
   Again, this module raise Timeout exception on timeout.

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list