LoverNet icon indicating copy to clipboard operation
LoverNet copied to clipboard

Wiki example crashes with multiple clients

Open shviller opened this issue 4 years ago • 3 comments

This example https://github.com/josefnpat/LoverNet/wiki/Example%3A-Sending-Latest-Data-To-Client crashes with Love 11 when I launch multiple clients:

Error: .\lovernet.lua:240: Error during service
stack traceback:
        [string "boot.lua"]:637: in function <[string "boot.lua"]:633>
        [C]: in function 'service'
        .\lovernet.lua:240: in function 'update'
        main.lua:13: in function 'update'
        [string "boot.lua"]:509: in function <[string "boot.lua"]:493>
        [C]: in function 'xpcall'

In my case, it crashes with 7 clients. If I duplicate the lovernet:update(dt) line in the server, it works "better". As in, it works with 7 clients. But if I add more (to the total of 12), it still crashes. Works ok with Love 0.10, even though it's visibly slow with this number of clients.

shviller avatar Feb 04 '21 21:02 shviller

Last commit was 2 years ago, and there hasn't been many updates since 2016, specially to docs. Also to note is that LÖVE 11.x was released on 2018 which is AFTER 2016, where the library was still being actively maintained. LÖVE 11.x updated the luasocket library to a newer version which can result in compatibility issues in it's API or overall functionality.

I don't think you should be calling lovernet:update(dt) repeatedly like that since you are confusing the internal timers by the way.

I would recommend you either look into other networking libraries, dive into the source and fix this library (you can then submit PRs to both the source code and the docs) or you can write your own networking code with luasocket and/or lue-enet (both built into LÖVE)

pablomayobre avatar Feb 11 '21 17:02 pablomayobre

To be perfectly honest, I created this issue mainly as a flag for those coming from awesome-love2d, so that they have an easier time seeing that no, this library doesn't work. Thanks for confirming it, by the way.

shviller avatar Feb 19 '21 15:02 shviller

Will ask Seppi and posibly request for it to be removed from awesome-love2d if not further support can be expected.

Thank you!

pablomayobre avatar Feb 19 '21 18:02 pablomayobre