Home > Net >  [the ASP. Net Core] start another thread processing SignalR or WebSocket sent the Json data, how to
[the ASP. Net Core] start another thread processing SignalR or WebSocket sent the Json data, how to

Time:01-12

Each plate friend hello,

There are currently using the WebSocket to receive the Client sent the Json data,
Json structure contains the function of the custom code, convenient I confirm what is going to take the Json data,

My current idea is to first establish a special deal with the follow-up work of the thread, and System. Threading. AutoResetEventSystem (or Threading. ManualResetEvent) waits for the trigger,
Then when the WebSocket received Json data, will drop the Json data into a pre-defined Buffer, and then trigger the signal,
Within the Thread to get the Buffer is established beforehand information immediately after processing, then process the results back to the WebSocket,

Don't know is there a better way? Because of concerns about the same WebSocket Client demand attachment is blocked, just want to say in this process...

Trouble plate on senior reply again, thank you,


  • Related