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 !
LoveéD and udp socket
Re: LoveéD and udp socket
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
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
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: LoveéD and udp socket
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
Also, to get your actual internet-facing public IP adress, use a website like whatismyip.com
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- wazoowazoo
- Prole
- Posts: 16
- Joined: Sun Jan 22, 2017 2:47 pm
Re: LoveéD and udp socket
Does my friend need to open his ports on his internet box so I can communicate with him without being on the same network ?
-
- Party member
- Posts: 107
- Joined: Wed Oct 15, 2014 5:00 pm
- Location: Yorkshire, England
Re: LoveéD and udp socket
Depends, whoever is running the server needs to have open ports.
Code: Select all
if not wearTheseGlasses() then
chewing_on_trashcan = true
end
- wazoowazoo
- Prole
- Posts: 16
- Joined: Sun Jan 22, 2017 2:47 pm
Re: LoveéD and udp socket
His computer ports ?
Re: LoveéD and udp socket
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.
Science and violence
Who is online
Users browsing this forum: No registered users and 4 guests