An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
ClientWebSocket method throw new InvalidOperationException(SR.GetString(SR.net_WebSockets_AlreadyStarted))
websocket_net_WebSockets_AlreadyStarted
1
Reputation point
hi all!
In thread method, using System.Net.WebSockets.ClientWebSocket class method ConnectAsync, but sometimes throw exception like this " new InvalidOperationException(SR.GetString(SR.net_WebSockets_AlreadyStarted))", sometimes is ok, can you help me ?
some code as follows:
try
{
ConnectAsync(new Uri(_url), new CancellationToken()).Wait()
}
catch (Exception ex)
{
....... // here, new InvalidOperationException(SR.GetString(SR.net_WebSockets_AlreadyStarted))
}
Developer technologies | C#
Developer technologies | C#
Sign in to answer