Page 1 of 1

LoveéD and udp socket

Posted: Sun Dec 02, 2018 2:48 pm
by wazoowazoo
Hello everyone,

I've been trying to to send data via udp to a friend, but he dosen't receive anything. I don't know if it is because of the ip address (his looks like 192.168.*.*, is that the address where i should send the data to ?) or the port (he set his to 87**). Could someone show me an example of a working server and a working client ? It would be very nice ! :awesome:

Re: LoveéD and udp socket

Posted: Tue Dec 04, 2018 1:47 pm
by Link
192.168.*.* is a private (local) IP Address - are you on the same local network as your friend? It won't work otherwise.

There's a tutorial and source code on the Wiki:
https://love2d.org/wiki/Tutorial:Networking_with_UDP
https://love2d.org/wiki/Tutorial:Networ ... -TheServer
https://love2d.org/wiki/Tutorial:Networ ... -TheClient

Re: LoveéD and udp socket

Posted: Tue Dec 04, 2018 4:35 pm
by zorg
Do note that those tutorials aren't the best, since, for one, you can indeed create the server itself with löve, and you don't need to mess around with building lua with sockets, and second, using (lua-)enet may be better than using luasocket, and both do come with löve built-in.

Also, to get your actual internet-facing public IP adress, use a website like whatismyip.com

Re: LoveéD and udp socket

Posted: Sun Dec 09, 2018 3:24 pm
by wazoowazoo
Does my friend need to open his ports on his internet box so I can communicate with him without being on the same network ?

Re: LoveéD and udp socket

Posted: Sun Dec 09, 2018 10:09 pm
by pedrosgali
Depends, whoever is running the server needs to have open ports.

Re: LoveéD and udp socket

Posted: Sun Dec 16, 2018 1:18 pm
by wazoowazoo
His computer ports ?

Re: LoveéD and udp socket

Posted: Wed Dec 26, 2018 3:50 pm
by HDPLocust
You or your friend must have white IP (accessible from global network) or external server (routable too) that connect users. Google NAT and ports and OSI-model.