Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConnectAsync()

Task System.Net.WebSockets.ClientWebSocket.ConnectAsync ( Uri uri,
CancellationToken cancellationToken )
inline

Definition at line 67 of file ClientWebSocket.cs.

68 {
69 if (uri == null)
70 {
71 throw new ArgumentNullException("uri");
72 }
73 if (!uri.IsAbsoluteUri)
74 {
76 }
77 if (uri.Scheme != "ws" && uri.Scheme != "wss")
78 {
80 }
81 switch ((InternalState)Interlocked.CompareExchange(ref _state, 1, 0))
82 {
83 case InternalState.Disposed:
84 throw new ObjectDisposedException(GetType().FullName);
85 default:
87 case InternalState.Created:
90 }
91 }
async Task ConnectAsyncCore(Uri uri, CancellationToken cancellationToken)
static string net_WebSockets_AlreadyStarted
Definition SR.cs:32
static string net_uri_NotAbsolute
Definition SR.cs:16
static string net_WebSockets_Scheme
Definition SR.cs:30
Definition SR.cs:7
static int CompareExchange(ref int location1, int value, int comparand)

References System.Net.WebSockets.ClientWebSocket._state, System.cancellationToken, System.Threading.Interlocked.CompareExchange(), System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(), System.FullName, System.Uri.IsAbsoluteUri, System.SR.net_uri_NotAbsolute, System.SR.net_WebSockets_AlreadyStarted, System.SR.net_WebSockets_Scheme, System.Net.WebSockets.ClientWebSocket.Options, System.Uri.Scheme, and System.Net.WebSockets.ClientWebSocketOptions.SetToReadOnly().