how to make a SimpleXMLRPCServer abort at CTRL-C under windows

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun Feb 7 01:29:20 EST 2010


En Sat, 06 Feb 2010 21:24:33 -0300, News123 <news123 at free.fr> escribió:
> Gabriel Genellina wrote:
>> En Fri, 05 Feb 2010 20:03:51 -0300, News123 <news123 at free.fr> escribió:
>>
>>> I'm using an XMLRPC server under Windows.
>>> What I wonder is how I could create a server, that can be killed with
>>> CTRL-C
>>
>> Python 2.6 and up behaves exactly as you want.
>> On previous versions you may use this:
>>
>>         def server_bind(self):
>>             self.socket.settimeout(1.0)
>>             SimpleXMLRPCServer.SimpleXMLRPCServer.server_bind(self)
>>
>
> Overloading  server_bind() with your version solved my problem.

Strange. With Python 2.6.4 I don't need to do that; I'd say the difference  
is in the OS or antivirus (some AV are known to break the TCP stack).

-- 
Gabriel Genellina




More information about the Python-list mailing list