Websocket compatibility issues

1

I am using the plain C# await httpListenerContext.AcceptWebSocketAsync(subProtocol: null), everything seems to work great and data is being sent and transmitted from Chrome successfully, however sometimes the connection seems to get dropped for no reason or the client will send the data partially, this is especially annoying since the data is JSON and I will only get half the object (and I am certain I send it full on the client)

I am testing on localhost so any connection issues aren't a possibility (not that they would be anyway because of TCP)

I see that I sometimes receive the following exception:

Error while processing account:The 'System.Net.Web
Sockets.ServerWebSocket' instance cannot be used for communication because it ha
s been transitioned into the 'Aborted' state.:System.Net.WebSockets.WebSocketExc
eption (0x80004005): The 'System.Net.WebSockets.ServerWebSocket' instance cannot
 be used for communication because it has been transitioned into the 'Aborted' s
tate. ---> System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__
c#
websocket
asked on Stack Overflow Jun 17, 2013 by user2489890 • edited Dec 27, 2018 by Cœur

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0