making a Windows NT service out of a python program

Bill Tutt billtut at microsoft.com
Thu Jul 15 12:33:24 EDT 1999


> From: Christian Tismer [mailto:tismer at appliedbiometrics.com]

> Bill Tutt wrote:
> > 
> > > From: Christian Tismer [mailto:tismer at appliedbiometrics.com]
> > >
> > >
> > > This is all great stuff if you have understood it already.
> > > For me, it is still unclear what makes up a service, and
> > > what I need at the minimum to turn a Python program into
> > > an NT service.
> > >
> > 
> > Not knowing ANYTHING about Medusa... I'll provide another 
> example service
> > right here, and try and explain things as I go...
> 
> That's fine. Medusa is just a Python program. I just need
> to run any Pprogram as a service. :-)
> 

Medusa uses non-blocking sockets, so check out get_request in the
TCPServerService class.

In particular after accepting the new connection in Medusa, you don't need
to issue the .setblocking(1) call. You should still call WSAEventSelct()
just in case someone else down the chain would like to turn the socket into
a blocking socket again.

Bill




More information about the Python-list mailing list