Re: closing a "forever" Server Socket

2007-01-22 Thread Gabriel Genellina
At Monday 22/1/2007 14:49, alessandro wrote: Oh my God! it's really so complicated? 3 modules (threading, SocketServer, select) only for design a way to shutdown a TCP server ...but they told me that python was easy... :) You already have the answer: replace serve_forever with your own lo

Re: closing a "forever" Server Socket

2007-01-22 Thread Laszlo Nagy
alessandro írta: > Oh my God! it's really so complicated? > > 3 modules (threading, SocketServer, select) only for design a way to > shutdown a TCP server > ...but they told me that python was easy... :) > I believe that SockerServer was created for testing purposes, although there are some

Re: closing a "forever" Server Socket

2007-01-22 Thread alessandro
Oh my God! it's really so complicated? 3 modules (threading, SocketServer, select) only for design a way to shutdown a TCP server ...but they told me that python was easy... :) I'm working on a simulator and I have a monitor server that collects information. I can shutdown it using Ctrl-C fro

Re: closing a "forever" Server Socket

2007-01-22 Thread Laszlo Nagy
alessandro írta: > thanks > > infact the server_forever() method is only a serve() method inside an > infinite loop. > > many thanks again, > Here is a snipped that show a "software terminateable threading TCP socker server". The "server" object is a SocketServer instance, server_stopped is a

Re: closing a "forever" Server Socket

2007-01-22 Thread alessandro
thanks infact the server_forever() method is only a serve() method inside an infinite loop. many thanks again, Alessandro Matimus ha scritto: > > I want to ask if someone knows a better way for closing a "forever > > server" or if there is a lack in my design. > > Generally you don't create a

Re: closing a "forever" Server Socket

2007-01-18 Thread Matimus
> I want to ask if someone knows a better way for closing a "forever > server" or if there is a lack in my design. Generally you don't create a 'forever server'. You create an 'until I say stop' server. I would do this by looking at the 'serve_forever' method, and implementing my own 'serve_until_

closing a "forever" Server Socket

2007-01-18 Thread alessandro
Hi all, This is my framework for create TCP server listening forever on a port and supporting threads: import SocketServer port = ip = "192.168.0.4" server_address = (ip, port) class ThreadingTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): pass class Handler(SocketServer.