Re: multi-threaded webcam with SimpleAsyncHTTPServer.py (updated)

2007-01-08 Thread Ray Schumacher
Better asyncore.loop use. Also fixes a late bug in my first post of code: PILFile.seek(0) needed since PIL.save does not reset the pointer. class ImageServer(RequestHandler): def __init__(self, conn, addr, server): asynchat.async_chat.__init__(self,conn) self.client_addres

Re: multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-08 Thread Ray Schumacher
>>Question, though: how can I unblock asyncore.loop(), or at least be >>able to interrupt it? >Why do you want to do that? I was then thinking along the lines of a Netmeeting/visual chat program, rather than a daemon-type server, where one might want to terminate more quickly. Searching furth

Re: multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-08 Thread Gabriel Genellina
At Monday 8/1/2007 02:44, Ray Schumacher wrote: Question, though: how can I unblock asyncore.loop(), or at least be able to interrupt it? To kill this server I need to hit CNTRL-C and then attempt to GET an image from Firefox, Python then throws KetboardInterrupt. Why do you want to do that?

Re: multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-08 Thread Bjoern Schliessmann
Ray Schumacher wrote: > I'll be trying implementing some streaming next. > Question, though: how can I unblock asyncore.loop(), Not at all. That's the way event loops work. > or at least be able to interrupt it? Sorry for the stupid question, but why would you want to do that? > Other suggesti

multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-07 Thread Ray Schumacher
The class seems to work pretty well - very basic and fast, it just serves images from the specified port and camera device (USB cam). I added an ImageServer class and some code to __main__ class ImageServer(RequestHandler): def __init__(self, conn, addr, server): asynchat.async_chat.