Home > Net >  Whether the websocket server must receives the message asynchronously to prevent obstruction?
Whether the websocket server must receives the message asynchronously to prevent obstruction?

Time:09-19

Websocket I have Fleck on the framework, the following is a simple code structure, forward I want to be a chat room server
 
WebSocketServer server=new WebSocketServer (ws://0.0.0.0: "8002");

Server. Start (socket=& gt;
{
Socket. The OnOpen ()==& gt;//connection is established event
{

};
Socket. OnClose=()=& gt;//connection is closed event
{

};
Socket. The OnMessage message==& gt;//to accept client message event
{
Chat rooms, directly forward SendMsg to specify a user here, more users will jam, how to do???????
};
});

CodePudding user response:

All right.. The somebody else is asynchronous.. You just write directly.

I used this relatively lightweight rather easy to use..
  •  Tags:  
  • C#
  • Related