C# Socket Server
        Posted  
        
            by 
                Snoopy
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Snoopy
        
        
        
        Published on 2011-01-16T10:45:21Z
        Indexed on 
            2011/01/16
            10:53 UTC
        
        
        Read the original article
        Hit count: 341
        
In .NET 3.5 a new socket classes was released: http://msdn.microsoft.com/en-us/library/bb968780.aspx
i found a sample but some questions regarding best practicses are remaining: http://code.msdn.microsoft.com/nclsamples/Wiki/View.aspx?title=Socket%20Performance
m_numConnections (the maximum number of connections the sample is designed to handle simultaneously) is probably equal to the amount of cpu cores i have.
m_receiveBufferSize is the size for one packet? like 8kb? how should i handle a length byte?
opsToPreAlloc i dont understand. is this if i code a transparent proxy?
Regarding the multithreading, what should be used? The reactive extension seem to be a good choice. Has anyone tried this in a real world project? Are there better options? I had bad experiences with the .NET thread pool in the past.
© Stack Overflow or respective owner