I attached the sample code.
It works if client is localhost and I run client and server on same machine.
But, as soon as I try to run client as ipv4 address (192.168,etc) and on
different machines (server on desktop and client on laptop for example), it doesn't work.
I already ruled out router/PC/firewall problems, because I can do LAN on Love2D for
some other projects/games out there, so that's not the issue. That means only problem
is I am not doing something correct with the code, I am missing something or what?
Thanks guys!
problem with LAN connection enet udp
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- EngineerSmith
- Prole
- Posts: 38
- Joined: Thu Dec 02, 2021 11:38 am
- Contact:
Re: problem with LAN connection enet udp
Honestly looking through the code, all is fine and it should work. Therefore it would be a network issue with a firewall. On windows make sure the love.exe has access through private and public networks for inbound and outbound connections.
I'm on Android right now, but I'll have a look to see if I can run the code when I'm on windows next
I'm on Android right now, but I'll have a look to see if I can run the code when I'm on windows next
- EngineerSmith
- Prole
- Posts: 38
- Joined: Thu Dec 02, 2021 11:38 am
- Contact:
Re: problem with LAN connection enet udp
(I said this on discord, but for others interested)
The code works perfectly on my machine across a private (and public) network when I tested it. So the issue would lie with a firewall blocking the UDP packets either coming into the server, or out of the server
The code works perfectly on my machine across a private (and public) network when I tested it. So the issue would lie with a firewall blocking the UDP packets either coming into the server, or out of the server
Re: problem with LAN connection enet udp
The OP title says .'LAN' but OP post says not LAN.
I'm confused and maybe others are too.
I'm confused and maybe others are too.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
Re: problem with LAN connection enet udp
OP post says LAN too. It says that it works with server and client in the same machine but not between machines in a LAN.
Works for me between Linux machines in a LAN, too.
- EngineerSmith
- Prole
- Posts: 38
- Joined: Thu Dec 02, 2021 11:38 am
- Contact:
Re: problem with LAN connection enet udp
For others who aren't on discord, the issue was resolved. They were using the client's own private ip rather than using the server's machine private ip when trying to connect
Re: problem with LAN connection enet udp
Let me know if you get this to work on the big bad internet ie not (LAN).
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
- EngineerSmith
- Prole
- Posts: 38
- Joined: Thu Dec 02, 2021 11:38 am
- Contact:
Re: problem with LAN connection enet udp
If it works on LAN, it works on WAN. It is just a different IP (server's public ip) and port forwarding on the router to the private ip
Edit: How the internet works:
Instead of each machine on the internet having a public IP (because we would run out of them) we just give each router a public IP. The router the acts like a switch between the private network and the public network using NAT (Network address translation). Port forwarding just tells the router how to translate(redirect) a public port to a machine's port that within it's private network.
Re: problem with LAN connection enet udp
I use sock.lua and it works fine on local server and fine on LAN but not on internet.
I think I've done port forwarding, I think I've done firewalls, I think I've used external IP yet it doesn't work so - sure - I might have done something wrong, but others say UDP and NAT punch-through is hard.
So, if anyone can get this to work it would form a great baseline and a point of reference for me to troubleshoot.
I think I've done port forwarding, I think I've done firewalls, I think I've used external IP yet it doesn't work so - sure - I might have done something wrong, but others say UDP and NAT punch-through is hard.
So, if anyone can get this to work it would form a great baseline and a point of reference for me to troubleshoot.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
- EngineerSmith
- Prole
- Posts: 38
- Joined: Thu Dec 02, 2021 11:38 am
- Contact:
Re: problem with LAN connection enet udp
By LAN is the client connecting to the private ip of the server machine? 192.168.*.* or 10.0.0.*, or are you using localhost to connect to the server. Make sure the address for the server is as I've had issues where only works on that machine and not on the private network (Which makes sense why localhost only works locally).
Code: Select all
*
Code: Select all
localhost
Who is online
Users browsing this forum: Google [Bot] and 3 guests