Okay so I'm bugged, I don't know which library to use for the multiplayer. Is it socket or enet?
I have created a "ping/pong" program that constantly sends "ping" to a server and "pong" to a client both in socket and enet.
Now the problem is that when I start 10 clients the socket one starts getting really slow(only 2 of 10 clients receive "pong" and the other 8 don't receive anything), but with enet every 10 clients receive "pong".
But the thing that bugs me is that enet one, needs to receive every time a packet otherwise the client disconnects(it uses the "while event do" loop) is there any possible way to fix that, I don't want to send every time a packet, I want to send them in delays(1 second...) but if I do it the server doesn't receive anything and stops sending the client packets.
The code I used for the enet is: https://love2d.org/wiki/lua-enet
So to wrap things up, which library is better for multiplayer games socket or enet?
And is it possible to send a delayed packet using enet without stopping the while event do loop? Could you provide code?
...I have been trying to figure this thing out for the past 2 days so I decided to jump on forums(I googled it everywhere, didn't help)...
I have been trying to figure this out for the past 2 day pls help ;(
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: I have been trying to figure this out for the past 2 day pls help ;(
Enet works on top of sockets. So you just need to program your game properly. And networking just happens to be the hardest part of programming a game, so you should expect tons of problems like this.
You must program it to allow missing a packet and continue running anyway. As for most of your peer not receiving packets, you're probably doing something very silly; under normal circumstances the socket library is more than well suited to handle thousands of active connections.
You must program it to allow missing a packet and continue running anyway. As for most of your peer not receiving packets, you're probably doing something very silly; under normal circumstances the socket library is more than well suited to handle thousands of active connections.
Re: I have been trying to figure this out for the past 2 day pls help ;(
Just use sock.lua, it's a wrapper on top of enet.. even easier
-
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 5 guests