0
다음 코드를 실행하려고 할 때 서버가 작동하지 않으면 Connection 거부 오류가 발생합니다.Python에서 연결을 유지하는 방법
아래의 발신자가 원격 서버가 실제로 연결되어 성공적으로 연결될 때까지 계속 연결을 설정하려고 할 수 있습니까?
HOST = client_ip # The remote host
PORT = port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.sendall(msg)
if expect_receive:
received_data = s.recv(1024)
print received_data
#client has started
s.close()
return
절대적으로 뛰어남! 고맙습니다! – Jobs