There is a Websocket server which is written using the non-blocking Socket. Is it possible, without using poll and select, to handle 10k + connections using only Receive. Like that

start = Socket.Receive(buffer, start, count, SocketFlags.None, out error); if (error != SocketError.Success && error != SocketError.WouldBlock) { throw new Exception(); } 

What errors does this approach ignore and what is the optimal processing time for a single message (receiving and sending back) with a load of 10k connections at the same time?

  • It is not quite clear what kind of method you have - Tcp.Receive . This makes it very difficult to understand the question ... - Pavel Mayorov
  • Tcp.Receive is a standard call to Socket.Receive .Net Framework. More details can be found here github.com/jackyt1988t/WebSocket . The point is that one can limit oneself to calling only this function for checking socket errors and what promises it for server performance - Jackyt1988t

0