You should probably use a network tracer to track down the protocol error.
Websocket Error: WeSocketGetAction Api is throwing this exception System.Net.WebSockets.WebSocketException (0x83760002): Invalid data format for the specific protocol operation
We have a server written in C# where we are using the HttpListenerWebSocketContext class to create the websocket connections.
This Websocket connection is working fine most of the time but getting below mentioned sporadic issue sometimes.
System.Net.WebSockets.WebSocketException (0x83760002): Invalid data format for the specific protocol operation
When I tried to dig the issue deeper, I came to this API(WebSocketGetAction: https://learn.microsoft.com/en-us/windows/win32/api/websocket/nf-websocket-websocketgetaction) which can throw this exception.
E_INVALID_PROTOCOL_OPERATION : Protocol performed invalid operations. This is only returned for receive operations.
May I know the exact reason in which situation we can get this exception
Thanks for your answer, I attached the WireShark(Network Tracer) to check the packet issue and found out one surprising thing.
The data which should have communicated over WebSocket Protocol is communicating through TCP.
I guess because of this WebSocket is throwing that exception.
Sign in to comment