With MessageWebSockets, sometimes MessageReceived event is called, and MessageWebSocketMessageReceivedEventArgs->GetDataReader() throws Platform::COMException, HRESULT = 0x80072EFE (WININET_E_CONNECTION_ABORTED).
I do not have access to the remote websocket server, hence not sure what causes the connection to be disconnected. The MessageType from the MessagReceived event is UTF8 when this happens. After this, any other operations on the socket like send returns the same error.
Also, the Closed event is never called, hence this cannot be a server initiated close.
Check with WinRT team :
1. Is this how connection abortions are communicated to the users?
2. Is it safe to assume that whenever GetDataReader() throws an exception, the connection has gone bad?
3. Are there scenarios where GetDataReader() can throw an exception but the socket is still in a valid state, for example: if the endpoint receives an empty UTF8 message?
Once we know how WinRT communicates errors back, handle the same in our implementation.
Comments: Fixed in development branch. Will in 2.3.0 release.
I do not have access to the remote websocket server, hence not sure what causes the connection to be disconnected. The MessageType from the MessagReceived event is UTF8 when this happens. After this, any other operations on the socket like send returns the same error.
Also, the Closed event is never called, hence this cannot be a server initiated close.
Check with WinRT team :
1. Is this how connection abortions are communicated to the users?
2. Is it safe to assume that whenever GetDataReader() throws an exception, the connection has gone bad?
3. Are there scenarios where GetDataReader() can throw an exception but the socket is still in a valid state, for example: if the endpoint receives an empty UTF8 message?
Once we know how WinRT communicates errors back, handle the same in our implementation.
Comments: Fixed in development branch. Will in 2.3.0 release.