|
Post by branster707 on Nov 1, 2021 21:33:56 GMT
So I’ve just started learning how to use sockets and Im able to host a server on TouchLua and connect to it using Python on my laptop. However, when I try to host the server on my laptop and connect to it through TouchLua then I get the error “No route to host”. I’m not sure what could be causing this since I just started learning about sockets, so any help would be appreciated.
local socket = require("socket")
host = [Laptop’s IP] port = [Port #] local client = socket.tcp() local status, err = client:connect(host,port)
if not err then print("Connection established as "..tostring(client)) client:send("Hello there") else error(err) end
while true do end
For the python server code, I do:
server = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) server.bind((host,port)) server.listen(5)
while True: client, addr = server.accept() print(“Connection Established with “+str(addr))
|
|