0
0to60
I have a windows service that when started creates two threads: one thread
that runs a TcpListener waiting for TcpClients to connect, and another
thread that reads from the resulting sockets. My stop code .Abort()s the
threads and .Stop()s the listener.
One one of my computers, the service runs like, well...a service. It starts
and stops nicely. On a different computer (eventually this service will be
running on 50+ machines) the service starts up fine, but when you stop it it
seems to hang. Services.mmc reports "Stopping". The very first line in my
Stop() method writes to the Event Log, but that line is never getting
executed (no log entry appears).
Most often, it stays in "Stopping" until I kill the process via the task
manager. When I do this, subsequent attempts to Start result in
Services.mmc telling me "The service on Local Computer started and the
stopped. Some services stop automatically if they have no work to do..."
I'd say its something to do with my shutdown, like me trying to abort the
threads and them not cooperating, but like I say it works fine on one PC but
not another.
that runs a TcpListener waiting for TcpClients to connect, and another
thread that reads from the resulting sockets. My stop code .Abort()s the
threads and .Stop()s the listener.
One one of my computers, the service runs like, well...a service. It starts
and stops nicely. On a different computer (eventually this service will be
running on 50+ machines) the service starts up fine, but when you stop it it
seems to hang. Services.mmc reports "Stopping". The very first line in my
Stop() method writes to the Event Log, but that line is never getting
executed (no log entry appears).
Most often, it stays in "Stopping" until I kill the process via the task
manager. When I do this, subsequent attempts to Start result in
Services.mmc telling me "The service on Local Computer started and the
stopped. Some services stop automatically if they have no work to do..."
I'd say its something to do with my shutdown, like me trying to abort the
threads and them not cooperating, but like I say it works fine on one PC but
not another.