Most stripped down C# TCP / UDP networking solution? (similar to Lidgren)

Looking for a C# networking library with nothing integrated into Unity. Or it can have integration but not require it. Was using Lidgren Network but it is no longer updated.

All we need is:

  • spin up client / server
  • connect, disconnect, some error check
  • send custom payload messages as reliable or unreliable
  • NAT punch would be nice (if that’s still a big issue)
  • Windows platform

All the client prediction, matchmaking, etc. is already a solved issue and not needed. Do not want anything that requires building per-object RPCs or flagging game object variables for replication.

Can any of the existing popular networking solutions be used this way? Like Photon or Fishnet? Can I spin up a server in client in those and send arbitrary payload messages? If I can spin up a client and server in a C# console program without Unity even running that is the right direction …

Sounds like you are looking for a low level transport.

For UDP, the most used are probably enet, litenetlib, kcp.
We actually ported kcp to C# after having scaling issues with enet/litenetlib.

For TCP, we also had to make our own transport due to lack of existing TCP transports.

The above are all MIT licensed, so it’s safe to use in your project :slight_smile:

3 Likes

Maybe LiteNetLibManager? It’s easy to use and I’m fairly sure checks these boxes. It is based on LiteNetLib.

I disagree with the scaling issues comment. We use it and have tested thousands of CCU without issue. SURIYUN also uses it for scaling, and they’re a very well rated asset developer.

The headers are also extremely small in LiteNetLib, significantly less than KCP, using only 12% the bandwidth for reliable messages!

LiteNetLibManager is MIT and created by individuals that have already created many ‘transports’ in the past. There are recent updates on the git as well.

1 Like

That looks promising. Thanks. :slight_smile:

Thanks. Look pretty good. Scaling isn’t a huge issue since our game is 4-8 player coop.

1 Like

Ligren.Network is still being used and developed, just not by the original author. See GitHub - space-wizards/SpaceWizards.Lidgren.Network: Lidgren Network Library (Space Wizards edition)

I use LiteNetLib (GitHub - RevenantX/LiteNetLib: Lite reliable UDP library for Mono and .NET) and have had 0 issues with it. Pretty easy to integrate in away that you can abstract it out so if you did run into issues it can be easily replaced.

1 Like

As someone which is utilizing LiteNetLib in a framework used by tens of thousands, and I know I said this in the past, but it deserves a really big +1 from me.