Tutorial:Networking with UDP connection refused

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
THCDenton
Prole
Posts: 2
Joined: Wed Jan 25, 2023 4:44 am

Tutorial:Networking with UDP connection refused

Post 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?
User avatar
Bigfoot71
Party member
Posts: 287
Joined: Fri Mar 11, 2022 11:07 am

Re: Tutorial:Networking with UDP connection refused

Post 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. ^^
Attachments
UDP-TEST.zip
(1.79 KiB) Downloaded 51 times
My avatar code for the curious :D V1, V2, V3.
THCDenton
Prole
Posts: 2
Joined: Wed Jan 25, 2023 4:44 am

Re: Tutorial:Networking with UDP connection refused

Post 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.
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: Tutorial:Networking with UDP connection refused

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 15 guests