Forum posts for srvany.exe

Problems running python program with srvany.exe

I must preface this with a full disclaimer that i'm very early in my python development days

I've made a simple python program that waits for a socket connection to the local ip address over port 20000. When it gets a connection, it pops up a message alert using the win32api.

#tcpintercomserver.py
import socket
import sys
import win32api

ip = socket.gethostbyname(socket.gethostname())

#socket creation
sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)

#Binding
server_address = (ip, 20000)
sock.bind(server_address)
print server_address

#Listen
sock.listen(1)

while True:
# Wait for a connection
connection, client_address = sock.accept()
win32api.MessageBox(0,'MessageText','Titletext', 0x00001000)
# Close Connection
connection.close()


I also have a mated client program that simply connects to the socket. The script takes an argument of the host you're trying to reach (DNS name or ip address)

#tcpintercomcli.py

import socket
import sys

# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Connect the socket to the port where the server is listening
server_address = (sys.argv[1], 20000)
sock.connect(server_address)


This all runs fine as scripts. I then used CX_Freeze to turn them into executables. Both run just like they did when they were scripts.

Now i've taken the server script and connected it to a service with srvany.exe and use of the SC command in windows.

I set up the service using SC create 'intercom' binPath= 'C:distsrvany.exe'

Under the intercom service key in the registry, i've added the Parameter's key, and under there set Application to a string value c:dist cpintercomserver.exe

I then perform a 'net start intercom' and the service launches successfully, and the tcpintercomserver.exe is listed as a running process. However, when i run the tcpintercomcli.py or tcpintercomcli.exe, no alert comes up.

I'm baffled...is there something with the CX_Freeze process that may be messing this up?

View complete forum thread with replies

Other posts related to srvany.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Windows srvany.exe and service STOP
Problems running python program with srvany.exe
srvany.exe does not start .bat file
Creating Service from Executable (INSTSRV.EXE and SRVANY.EXE) Error - 'Service started and t…
Specify command line for application while creating service using SRVANY.EXE
Searching for srvany.exe from Windows 7 Resource Kit: is this actual software or just a book?
Installing srvany.exe to run a jar file as a service using InstallShield (without editing th…

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.