파이썬 데몬을 작성 중이며 요청을 기다리고 일부 데이터를 반환합니다. 그러나 클라이언트가 스크립트를 요청할 때 데몬은 작업을 중단했습니다. 이 내가 당신이 정말로 서버 기능으로 원하는 특정 아니지만, 당신의 예에 따라 코드데이터를 보낸 후 파이썬 소켓 + 데몬이 중지되었습니다.
......
def run(self):
while True:
server_socket = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12345 # Reserve a port for your service.
server_socket .bind((host, port)) # Bind to the port
server_socket .listen(5)
client_socket, address = server_socket.accept()
# Establish connection with client.
print 'Got connection from', address
logging.info(address)
#data = client_socket.recv(2048)
data = client_socket.recv(1024)
logging.info(data)
......