socket timeout on win32

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

socket timeout on win32

Charles Duffy-6

I'm seeing the following while content is being streamed to VLC (which
consumes it at a rate considerably slower than that it's produced at):

Traceback (most recent call last):
   File "cherrypy\_cpwsgiserver.pyc", line 203, in run
   File "cherrypy\_cpwsgiserver.pyc", line 147, in write
   File "socket.pyc", line 256, in write
   File "socket.pyc", line 243, in flush
timeout: timed out

A bit of googling finds that CherryPyWSGIServer is calling
self.socket.settimeout(1) during start() "so KeyboardInterrupt can be
caught on Win32".

Any suggestions wrt The Right Way to resolve this? (Increasing or
removing the timeout feels like the obvious solution, but I don't know
the side effects).


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: socket timeout on win32

Robert Brewer
Charles Duffy wrote:
> I'm seeing the following while content
> is being streamed to VLC

uhhh... VideoLAN Client?

> (which consumes it at a rate considerably
> slower than that it's produced at):
>
> Traceback (most recent call last):
>    File "cherrypy\_cpwsgiserver.pyc", line 203, in run
>    File "cherrypy\_cpwsgiserver.pyc", line 147, in write
>    File "socket.pyc", line 256, in write
>    File "socket.pyc", line 243, in flush
> timeout: timed out
>
> A bit of googling finds that CherryPyWSGIServer
> is calling self.socket.settimeout(1) during
> start() "so KeyboardInterrupt can be caught
> on Win32".
>
> Any suggestions wrt The Right Way to resolve this?
> (Increasing or removing the timeout feels like the
> obvious solution, but I don't know the side effects).
Increasing the timeout is the correct way to do this, but you're looking at the wrong settimeout call. The one inside start() is for the "server" socket [1]; you want to adjust the timeout for the "client" socket inside tick(). That value is configurable, so the following code should do the trick:

    cherrypy.config.update({'server.socket_timeout': 20})

In CherryPy 3, you can also do that procedurally:

    cherrypy.server.socket_timeout = 20


Robert Brewer
System Architect
Amor Ministries
[hidden email]

[1] See the excellent socket HOWTO at http://www.amk.ca/python/howto/sockets/ for a more complete discussion of these terms.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

winmail.dat (4K) Download Attachment