runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Different error message when ClientWebSocket tries to connect to a non websocket server in desktop

Open caesar-chen opened this issue 9 years ago • 0 comments

When ClientWebSocket tries to connect to a non websocket server, we will get a WebSocketException. But the error message is different in desktop. Which causes failure for this assert: https://github.com/dotnet/corefx/blob/master/src/System.Net.WebSockets.Client/tests/ConnectTest.cs#L32

In framework, status 101 is the first case to throw, and has error message (The server returned status code '{0}' when status code '101' was expected): https://github.com/Microsoft/referencesource/blob/master/System/net/System/Net/WebSockets/ClientWebSocket.cs#L265

In core, status 101 is the third case to throw, and has error message (Unable to connect to the remote server): https://github.com/dotnet/corefx/blob/master/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs#L325

Need to change implementations on all platforms, and make sure that no other tests are failing because of the change.

caesar-chen avatar May 26 '17 16:05 caesar-chen