Sockets and Windows Services

B

Bob

Hello All:
We've developed a Windows Service that is responsible for checking for
updates and downloading them. It then installs the updates by running
a seperate console executable. This console app communicates status
message back to the service via TCPListener/TCPClient code and works
fine if we run the app from the command line. However, it is halting
on the call to open the socket when started from the service. We are
using System.Diagnostics.Process class to launch the .exe, and there is
no exception that is thrown.
Is there some restriction on opening a socket on a thread spawned from
a windows service?
-Bob
 
B

Bob

Found the problem - for the next poor soul who has this problem. We
are reading the port id from .config file and were using
Environment.CurrentDirectory. This defaults to \Windows\System32 for a
Windows Service. The TCPListener constructor was not throwing an
error, even though we passed in a null.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top