Best method for an NT service and python to interact?

Peter Hansen peter at engcorp.com
Thu Nov 20 21:45:14 EST 2003


Charlie Orford wrote:
> 
> I have been asked to develop a python client that can talk to an NT service
> (coded in C). Does anyone have any advice for the best way in which to go
> about this task?
> 
> The NT service monitors file access. When a file of a specific type is
> accessed I need to inform the python client.
> 
> Would it be better for the NT service to message the python client or would
> it make more sense for the python client to poll the NT service at set
> intervals (every 1000ms for example)?

My first thought would be to send a UDP packet to localhost from the
NT service whenever the event of interest happens.  That's assuming
that it's meaningful to the service that this is happening... if the
service is more generic, maybe send UDP whenever any file is accessed.

The client, when running, simply listens for those packets on a 
predetermined port.  If you aren't doing the file-type filtering in
the service, the client does it and the NT service can stay very
simple and generic which, since it's C code, is probably best.

-Peter




More information about the Python-list mailing list