...
while(webSocket.IsConnected && !cancellation.IsCancellationRequested) {
try {
var messageText = await webSocket.ReadStringAsync(cancellation).ConfigureAwait(false);
...
messageProcess(messageText) ;
await webSocket.WriteStringAsync(messageText, cancellation).ConfigureAwait(false);
...
so:
during the messageProcess () - can be with await
when html client reload page or TAB close, the webSocket is not fired as disconnect ??
and cause stuck on webSocket.WriteString...
if it is not during the messageProcess the server websocket listner fires correctly
why the code is written with while(webSocket.isConnected...) ?
and not just :
websocket.OnMessage(...)
webSocket.OnDisconnect(...)
webSocket.OnError(...)
so even on during messageProcess, if occur the disconnect event it will be fired ?
- can you send any code example how to resolve the messageProcess ?
any help ?
regards,
Mano