Jan-13-2025, 08:25 AM
Hi,
I'm trying to create a socket with python:
Mi server.py:
I'm trying to create a socket with python:
Mi server.py:
import socket
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('', 8089))
serversocket.listen(5) # become a server socket, maximum 5 connections
while True:
connection, address = serversocket.accept()
buf = connection.recv(64)
if len(buf) > 0:
print (buf)
breakMy client:import socket
print("Client calling .....")
socket_main = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_main.connect(('192.168.1.171', 8089))
while True:
message = 'Hello'
socket_main.send(message.encode())I have disabled the firewall, but it says me:Traceback (most recent call last):
File "C:\script\client.py", line 6, in <module>
socket_main.connect(('192.168.1.171', 8089))
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused itAny help? Thanks
