I see ENet and LuaSocket. It's not super clear which one is supported or recommended.
The documentation for networking (when I google it) comes up with (luasocket): https://love2d.org/wiki/Tutorial:Networking_with_UDP
Although the side-bar in the documentation clearly lists both luasocket and enet.
For luasocket I am seeing notes like: "When using blocking operations (network connect/read/write, or socket.sleep), the whole LÖVE main loop will be blocked, and it is usually a bad idea. So use only non-blocking operations if possible, or use it in a thread."
Is there a distinction here between enet and luasocket? Is luasocket the right choice because it supports non-blocking operations?
Why are there two networking libraries in Love?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Mon Aug 15, 2022 4:00 pm
Re: Why are there two networking libraries in Love?
Both are included in LÖVE, and you use whichever one fits your needs the best. See https://www.reddit.com/r/love2d/comment ... s_luaenet/
They do network stuff a bit differently. LuaSocket supports both blocking operations (TCP, which sends packages reliably and in-order), and non-blocking operations (UDP, which sends packages unreliably and out-of-order). ENet basically implements TCP using UDP, which is suitable for many games as we don't want the game to freeze while doing network stuff, but we often do want some level of reliability (but not always).
They do network stuff a bit differently. LuaSocket supports both blocking operations (TCP, which sends packages reliably and in-order), and non-blocking operations (UDP, which sends packages unreliably and out-of-order). ENet basically implements TCP using UDP, which is suitable for many games as we don't want the game to freeze while doing network stuff, but we often do want some level of reliability (but not always).
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Nikki and 4 guests