Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to learn Raknet with C# and I found it extremely confusing.

The Raknet tutorial seems to work well in C++. I have already made the chat server from the tutorial.

I am looking to do something similar in C# but I'm having trouble.

So my main question is what is the best way to use Raknet from C#?

The following information would also be very helpful:

  • A good tutorial for Raknet and C# together
  • Sample C# code for Raknet

I've done a lot of research but I'm still stuck.

Maybe Raknet isn't what I need after all? Comments with more C#-centric alternatives would also be appreciated.

share|improve this question

closed as too broad by Josh Petrie Nov 11 '14 at 17:17

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

From the Wikipedia article: "RakNet is a C++ class library that provides TCP and reliable UDP transport." It's for C++, so you might well be on your own as far as .Net's managed C++ and C# go. If you're having this much difficulty, aren't there other TCP and UDP protocols you can use instead? – doppelgreener Jun 6 '12 at 23:56
I was wondering about that in my PD. My supervisor adviced me to use raknet in C# but everything I read made me think maybe is not the best option... – Oscar Foley Jun 7 '12 at 6:17
Why not take a look at SuperSocket? It's written purely in C# and although I haven't used it personally (yet), I've heard just so many recommendations of it. – Dunya Degirmenci Jun 7 '12 at 19:26
Thanks. I will take a look at SuperSocket :) BTW I am wondering now who downvoted my question.. did I made something wrong? – Oscar Foley Jun 7 '12 at 21:05
Downvote plus 4 votes to close, but no comments explaining why? – Tim Holt Jun 13 '12 at 16:02
up vote 6 down vote accepted

Everything you need can, more or less, be found on the official site,


There, they also have an official tutorial for using RakNet in C#, which is based on SWIG (just like raknetdotnet):


You may be interested in lidgren, which is written in C#:

A basic but complete tutorial for starters can be found here:

Good luck!

share|improve this answer
+1 for mentioning Lidgren. It's a great networking engine. – jmegaffin Jun 13 '12 at 16:31
Thanks. I have been googling a lot and I think I suffer overinformation. So many info about C++ hides good resources in C#. I will make a depth read on this links. I have already read about swig and found it a little bit confusing. – Oscar Foley Jun 13 '12 at 16:42
+1 I am testing Lidgren right now and seems very cool. Thanks! – Oscar Foley Jul 14 '12 at 18:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.