Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSprangle

Posted 17 September 2013 - 03:42 AM

Given you mention C#, you already have some very good tools in place you should be leveraging for for this. Specifically the async socket functions and the thread pool work together to give you a very fast way to process connections without blocking a large number of threads. While waiting for an async function to complete, .NET will release the thread back to the thread pool so that it can be used to process other connections. I suggest you have a read up on them and make sure you understand how the two interact.

 

If your server is running a standard main loop type arrangement for the actual game simulation you will want some way to communicate with it from the async handlers. Personally I make use of .NETs ConcurrentQueue. The items posted into the queue include metadata on which client sent the message etc.

 

This is not necessarily the fastest way to process a single message, but it is designed to scale nicely to a large number of them. Here are some starting points for you:

 

http://msdn.microsoft.com/en-us/library/5w7b7x5f.aspx

http://msdn.microsoft.com/en-us/library/bbx2eya8.aspx

 
Between these you get much of what the article is discussing.

#1Sprangle

Posted 17 September 2013 - 03:40 AM

Given you mention C#, you already have some very good tools in place you should be leveraging for for this. Specifically the async socket functions and the thread pool work together to give you a very fast way to process connections without blocking a large number of threads. I suggest you have a read up on them and make sure you understand how the two interact.

 

If your server is running a standard main loop type arrangement for the actual game simulation you will want some way to communicate with it from the async handlers. Personally I make use of .NETs ConcurrentQueue. The items posted into the queue include metadata on which client sent the message etc.

 

This is not necessarily the fastest way to process a single message, but it is designed to scale nicely to a large number of them. Here are some starting points for you:

 

http://msdn.microsoft.com/en-us/library/5w7b7x5f.aspx

http://msdn.microsoft.com/en-us/library/bbx2eya8.aspx

 
Between these you get much of what the article is discussing.

PARTNERS