views:

173

answers:

5

I've been looking for a decent network library for C#. It is going to be used with XNA 3.1, and .NET Framework 3.5. The multi-player style is going to be Server and Client. Currently I have been looking into Lidgren Library Network, but it seems outdated.

Anyone got some good suggestions for a good network library. It should be able to handle easily 30+ client connections at a time.

+1  A: 

You seem to be looking in the wrong place. You don't seem to have looked in the .NET Framework itself.

What about using WCF? What about using TcpListener?

What do you need that these do not provide?

John Saunders
+1  A: 

Have you tried the inbuilt .Net libraries found in System.Net? It is very unlikely that you need to use an external library at all. Here's an example of simple threaded TCP server and you may want to look at UDP as well. There are loads of tutorials if you just google around a bit.

Try looking at the System.Net.Sockets MSDN page for more information.

Callum Rogers
+2  A: 

WCF is one possibility, though it may be a bit heavyweight for this scenario. .NET Sockets, OTOH, are often too low-level; they're not an easy "component" to just plug in (both networking and multithreading must be learned well before the Socket class can be used correctly).

I wrote a library, Nito.Async.Sockets, which is part of Nito.Async. It removes multithreading considerations from socket programming, and also includes a higher-level abstraction that handles message framing and keepalives.

Stephen Cleary
+1  A: 

How is lidgren outdated? It is still the only major player in the .NET space for gaming networking.

Bjoern
+1  A: 

Your link is indeed outdated; but if you read the page it will direct you to the newer version: http://code.google.com/p/lidgren-network-gen3/

lidgren