Page 1 of 1

Tutorial:Networking with UDP connection refused

Posted: Wed Jan 25, 2023 5:09 am
by THCDenton
New to UDP and I just typed out the code over at https://love2d.org/wiki/Tutorial:Networking_with_UDP

I'm on PopOs and I've installed Love 11.4 and Lua 5.1.5
I've installed luasocket on my machine via luarocks
I start the server via the shell with the command

Code: Select all

lua ./main.lua
without any apparent issues
When I start the client with the command

Code: Select all

love ./
the connection refused error is thrown.

Initially I thought I might have introduced a typo, but nope, I copy-pasted the code at https://love2d.org/wiki/Tutorial:Networ ... -TheClient and https://love2d.org/wiki/Tutorial:Networ ... -TheServer and the connection is still refused.

I noticed this code is 11 years old now. Has much changed since then? Does this code work for you guys?

Re: Tutorial:Networking with UDP connection refused

Posted: Wed Jan 25, 2023 3:49 pm
by Bigfoot71
Yes it works for me still today, I compress it, try it. If it still gives you "connection refused" it can be:
  • A firewall problem, check that the port is usable (or any other network security setting)
  • A conflict problem with another program that uses the same port
  • A version problem used between your Lua package and the one embedded by Love2d
Once you have ruled out all these problems, tell us if it works or not. ^^

Re: Tutorial:Networking with UDP connection refused

Posted: Wed Jan 25, 2023 8:14 pm
by THCDenton
Thank you very much for giving that code a try! The files you posted ran as expected - but only once. I suspect it has something to do with my OS. If I get it working reliably I'll post my steps to solving it.

Re: Tutorial:Networking with UDP connection refused

Posted: Thu Jan 26, 2023 4:39 am
by Andlac028
In some OSes, port is marked ss used also some minutes after applications is closed, do derver may fail to bind. Try to chceck, if you creste and bind server successfully.