RevenantX / LiteNetLib

Lite reliable UDP library for Mono and .NET
https://revenantx.github.io/LiteNetLib/index.html
MIT License
3.07k stars 496 forks source link

Server not receiving request #156

Closed Upd4ting closed 6 years ago

Upd4ting commented 6 years ago

It seems that my server isn't receiving all the request. Client send around 30 request per second and the server only receive one sometime.

Client code: https://hastebin.com/omujamegod.cs Server code: https://hastebin.com/akavofogup.vbs

Library version: Last released version

Framework: Unity, .NET Framework

OS: Windows

RevenantX commented 6 years ago

@Upd4ting do you call PollEvents on server?

Upd4ting commented 6 years ago

@RevenantX Yeah I have this https://gyazo.com/881c2f84cbd612b1ce95a7673df74a13

RevenantX commented 6 years ago

@Upd4ting connection event works?

RevenantX commented 6 years ago

@Upd4ting this is very strange code anyway...

RevenantX commented 6 years ago

@Upd4ting look at example https://github.com/RevenantX/LiteNetLib/blob/master/LiteNetLibSampleUnity/Assets/GameClient.cs

Upd4ting commented 6 years ago

I'll read that and adapt my code to use this pattern, i'll tell you if that helps :) Thanks for being active on this!

Upd4ting commented 6 years ago

With this lib I can make so Client connect to server, and client dialog with the server and server respond right?

RevenantX commented 6 years ago

@Upd4ting you can do this with simple TCP socket (and with library) :) This library intended for fast multiplayer games)

Upd4ting commented 6 years ago

@RevenantX I don't want to use TCP because I need something fast. Does that mean that dialog between client-server is not possible with this library? I need something fast because i'm sending 30 request second with pictures from a camera and the server will do computer vision and send result

RevenantX commented 6 years ago

@Upd4ting any communication type is possible with this library. This just depends on how you implement this. This library is just transport.

RevenantX commented 6 years ago

@Upd4ting if all your data must be sent reliably (reliable ordered) better use TCP.

Upd4ting commented 6 years ago

@RevenantX TCP would be faster than this? I just need them ordered not reliable

Upd4ting commented 6 years ago

Is there an option for that ?

RevenantX commented 6 years ago

@Upd4ting https://github.com/RevenantX/LiteNetLib/blob/0.7/LiteNetLib/NetConstants.cs

RevenantX commented 6 years ago

@Upd4ting SendOptions.Sequenced.

Upd4ting commented 6 years ago

I have this error: Error: Unreliable packet size > allowed (1429) Is there a way to increase this?

RevenantX commented 6 years ago

@Upd4ting automatic fragmentation works only for reliable packets. So you can split packet by hands into small pieces. (by size of MTU)

Upd4ting commented 6 years ago

@RevenantX Yeah that's understandable. So if I need that ReliableOrdered will your UDP lib be faster that just a TCP implementation?

RevenantX commented 6 years ago

@Upd4ting no.

Upd4ting commented 6 years ago

@RevenantX Okay thanks. I'll do some testing on my side. Thanks for helping!