Skip to content Skip to sidebar Skip to footer

Cannot Access Python Server Running As Windows Service

I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create a Windows service. I installed it on a computer running Windows XP Pro SP3. However,

Solution 1:

Possibly the program may be terminated just after initialization. Please check whether it is continuously listening to the requests.

netstat -an |find /i "listening"

And analyze the command line parsed to the programs. You may use procexp to do that.

Solution 2:

First of all, whenever you implement a Windows service, be sure to add proper logging.

My worker threads were terminating because of the exception, "The socket operation could not complete without blocking."

The solution was to simply call sock.setblocking(1) after accepting the connection.

Solution 3:

Check to see that the service is running under the Nertwork Service account and not the Local System account. The later doesn't have network access and is the default user to run services under. You can check this by going to the services app under administrative tool in the start menu and looking for your service. If you right-click the service you can go to properties and change the user that it is run under.

Post a Comment for "Cannot Access Python Server Running As Windows Service"