Re: Resolving 10060, 'Operation timed out'



My manual says that socket has a settimeout(value) but I don't
seem to find anything on socket.setdefaulttimeout method you
refer to.

<snip>
settimeout( value)

Set a timeout on blocking socket operations. The value argument can be a
nonnegative float expressing seconds, or None. If a float is given, subsequent
socket operations will raise an timeout exception if the timeout period value
has elapsed before the operation has completed. Setting a timeout of None
disables timeouts on socket operations. s.settimeout(0.0) is equivalent to
s.setblocking(0); s.settimeout(None) is equivalent to s.setblocking(1). New in
version 2.3.

-Larry Bates



willitfw wrote:
> Does anyone know how to prevent this error from occurring: IOError:
> [Errno socket error] (10060, 'Operation timed out').
>
> I am using the following code without any luck. Obviously I am missing
> something.
>
> import socket
> socket.setdefaulttimeout(20)
>
> Thank you in advance.
>
> Tom Williams
>
.



Relevant Pages

  • Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
    ... I only mentioned alternatives to implementing a timeout. ... Most socket i/o code does not bother with a timeout at all. ... Via a BeginXXX method you tell .NET to call a specific method when the i/o completes, and when it completes, your method is called. ...
    (microsoft.public.dotnet.framework)
  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte ... socket function correctly? ... The PC would send the data and Pocket PC would receive it. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)
  • Re: Threads and socket.setdefaulttimeout
    ... settimeout on the socket) was because it seemed like the only way (and ... > their timeout period to allow other runnable threads to proceed. ... making the since-bad choice of using setdefaulttimeout to get timeouts ... code needs to check the lock to avoid conflict. ...
    (comp.lang.python)
  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte at ... socket function correctly? ... How come when I use the IE on the Pocket PC and started IIS on my PC. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)
  • Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
    ... underlying mechanism for the ReceiveTimeout property): ... socket, the socket state is indeterminate, and ... than using the ReceiveTimeout property. ... a timeout explicitly, rather than having the socket manage the timeout ...
    (microsoft.public.dotnet.framework)