Windows NT Service and Sockets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Olaf Meding

    Windows NT Service and Sockets

    How can I used WaitForMultiple Objects() with sockets? The code (shown
    below) respresents a very simple echo server using sockets. I need
    WaitForMultiple Objects() so I can wait for both a new connection and
    the stop command from the service manager.

    Your help is greatly appreciated. Thanks.

    Olaf


    def SvcDoRun(self):
    sock = socket(AF_INET, SOCK_STREAM)
    sock.bind(('loc alhost', 53574))
    sock.listen(1)

    connection, addr = sock.accept()
    data = connection.recv (1024)
    connection.send (data)
    connection.clos e()

    # We do nothing other than wait to be stopped!
    win32event.Wait ForSingleObject (self.hWaitStop ,
    win32event.INFI NITE)
  • Thomas Heller

    #2
    Re: Windows NT Service and Sockets

    OlafMeding@comp userve.com (Olaf Meding) writes:
    [color=blue]
    > How can I used WaitForMultiple Objects() with sockets? The code (shown
    > below) respresents a very simple echo server using sockets. I need
    > WaitForMultiple Objects() so I can wait for both a new connection and
    > the stop command from the service manager.
    >
    > Your help is greatly appreciated. Thanks.[/color]

    Look into win32file.WSAEv entSelect, it allows to associate an event
    object with FD_XXX network events.

    Thomas


    Comment

    Working...