I am trying to establish a socket connection but I am getting a WinError 10061. My question is how do get passed the active refusal?
Below is the code and traceback.
import socket
import sys
if name == “main”:
ip = ‘172.16.5.156’
port = 3004
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.connect((ip, port))
Traceback (most recent call last):
File “T:/Automation Engineering/Projects/UR5/Documents/TCP_IP/connect.py”, line 9, in
server.connect((ip, port))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it