MrMyrmex
Jan 09, 2018 - 21:46
Hi.
Everytime on run this TCP Client script on my iPhone i get the error message from the title. Any ideas why? The script works fine on Windows.
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 5005
BUFFER_SIZE = 1024
MESSAGE = "Hello, World"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP,TCP_PORT))
s.send(MESSAGE.encode('utf-8'))
data = s.recv(BUFFER_SIZE)
s.close()
print("recived data: ", data.decode('utf-8'))
BTW! I'm executing it with Python 3.6.