Sockets and Windows Services

  • Thread starter Thread starter Bob
  • Start date Start date
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
 
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.
 
Back
Top