SkyWay Unity SDK
公式APIリファレンス
読み取り中…
検索中…
一致する文字列を見つけられません
WebSocketSharp.WebSocket クラス

Implements the WebSocket interface. [詳解]

公開メンバ関数

 WebSocket (string url, Dictionary< string, string > customHeaders, params string[] protocols)
 Initializes a new instance of the WebSocket class with the specified URL and optionally subprotocols.
 
void Close ()
 Closes the connection.
 
void Close (ushort code)
 Closes the connection with the specified status code.
 
void Close (CloseStatusCode code)
 Closes the connection with the specified status code.
 
void Close (ushort code, string reason)
 Closes the connection with the specified status code and reason.
 
void Close (CloseStatusCode code, string reason)
 Closes the connection with the specified status code and reason.
 
void CloseAsync ()
 Closes the connection asynchronously.
 
void CloseAsync (ushort code)
 Closes the connection asynchronously with the specified status code.
 
void CloseAsync (CloseStatusCode code)
 Closes the connection asynchronously with the specified status code.
 
void CloseAsync (ushort code, string reason)
 Closes the connection asynchronously with the specified status code and reason.
 
void CloseAsync (CloseStatusCode code, string reason)
 Closes the connection asynchronously with the specified status code and reason.
 
void Connect ()
 Establishes a connection.
 
void ConnectAsync ()
 Establishes a connection asynchronously.
 
bool Ping ()
 Sends a ping to the remote endpoint.
 
bool Ping (string message)
 Sends a ping with the specified message to the remote endpoint.
 
void Send (byte[] data)
 Sends the specified data to the remote endpoint.
 
void Send (FileInfo fileInfo)
 Sends the specified file to the remote endpoint.
 
void Send (string data)
 Sends the specified data to the remote endpoint.
 
void Send (Stream stream, int length)
 Sends the data from the specified stream instance to the remote endpoint.
 
void SendAsync (byte[] data, Action< bool > completed)
 Sends the specified data to the remote endpoint asynchronously.
 
void SendAsync (FileInfo fileInfo, Action< bool > completed)
 Sends the specified file to the remote endpoint asynchronously.
 
void SendAsync (string data, Action< bool > completed)
 Sends the specified data to the remote endpoint asynchronously.
 
void SendAsync (Stream stream, int length, Action< bool > completed)
 Sends the data from the specified stream instance to the remote endpoint asynchronously.
 
void SetCookie (Cookie cookie)
 Sets an HTTP cookie to send with the handshake request or response.
 
void SetCredentials (string username, string password, bool preAuth)
 Sets the credentials for the HTTP authentication (Basic/Digest).
 
void SetProxy (string url, string username, string password)
 Sets the URL of the HTTP proxy server through which to connect and the credentials for the HTTP proxy authentication (Basic/Digest).
 
void SetUserHeader (string name, string value)
 Sets a user header to send with the handshake request or response.
 

プロパティ

CompressionMethod Compression [get, set]
 Gets or sets the compression method used to compress a message.
 
IEnumerable< CookieCookies [get]
 Gets the HTTP cookies included in the handshake request/response.
 
NetworkCredential Credentials [get]
 Gets the credentials for the HTTP authentication (Basic/Digest).
 
bool EmitOnPing [get, set]
 Gets or sets a value indicating whether the interface emits the message event when it receives a ping.
 
bool EnableRedirection [get, set]
 Gets or sets a value indicating whether the URL redirection for the handshake request is allowed.
 
string Extensions [get]
 Gets the extensions selected by the server.
 
NameValueCollection HandshakeResponseHeaders [get]
 Gets the HTTP headers included in the handshake response.
 
bool IsAlive [get]
 Gets a value indicating whether the communication is possible.
 
bool IsSecure [get]
 Gets a value indicating whether the connection is secure.
 
Logger Log [get, set]
 Gets the logging function.
 
bool NoDelay [get, set]
 Gets or sets a value indicating whether the underlying TCP socket disables a delay when send or receive buffer is not full.
 
string Origin [get, set]
 Gets or sets the value of the HTTP Origin header to send with the handshake request.
 
string Protocol [get, set]
 Gets the name of subprotocol selected by the server.
 
WebSocketState ReadyState [get]
 Gets the current state of the interface.
 
ClientSslConfiguration SslConfiguration [get]
 Gets the configuration for secure connection.
 
Uri Url [get]
 Gets the URL to which to connect.
 
TimeSpan WaitTime [get, set]
 Gets or sets the time to wait for the response to the ping or close.
 

イベント

EventHandler< CloseEventArgsOnClose
 Occurs when the connection has been closed.
 
EventHandler< ErrorEventArgsOnError
 Occurs when the interface gets an error.
 
EventHandler< MessageEventArgsOnMessage
 Occurs when the interface receives a message.
 
EventHandler OnOpen
 Occurs when the connection has been established.
 

詳解

Implements the WebSocket interface.

This class provides a set of methods and properties for two-way communication using the WebSocket protocol.

The WebSocket protocol is defined in RFC 6455

.

構築子と解体子

◆ WebSocket()

WebSocketSharp.WebSocket.WebSocket ( string url,
Dictionary< string, string > customHeaders,
params string[] protocols )
inline

Initializes a new instance of the WebSocket class with the specified URL and optionally subprotocols.

引数
urlA string that specifies the URL to which to connect. The scheme of the URL must be ws or wss. The new instance uses a secure connection if the scheme is wss.
protocolsAn array of string that specifies the names of the subprotocols if necessary. Each value of the array must be a token defined in RFC 2616.
例外
ArgumentExceptionurl is an empty string. -or- url is an invalid WebSocket URL string. -or- protocols contains a value that is not a token. -or- protocols contains a value twice.
ArgumentNullExceptionurl is null.

関数詳解

◆ Close() [1/5]

void WebSocketSharp.WebSocket.Close ( )
inline

Closes the connection.

This method does nothing if the current state of the interface is Closing or Closed.

◆ Close() [2/5]

void WebSocketSharp.WebSocket.Close ( CloseStatusCode code)
inline

Closes the connection with the specified status code.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeOne of the CloseStatusCode enum values. It specifies the status code indicating the reason for the close.
例外
ArgumentExceptioncode is an undefined enum value. -or- code is CloseStatusCode.ServerError. It cannot be used by a client. -or- code is CloseStatusCode.MandatoryExtension. It cannot be used by a server.

◆ Close() [3/5]

void WebSocketSharp.WebSocket.Close ( CloseStatusCode code,
string reason )
inline

Closes the connection with the specified status code and reason.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeOne of the CloseStatusCode enum values. It specifies the status code indicating the reason for the close.
reasonA string that specifies the reason for the close. Its size must be 123 bytes or less in UTF-8.
例外
ArgumentExceptioncode is an undefined enum value. -or- code is CloseStatusCode.ServerError. It cannot be used by a client. -or- code is CloseStatusCode.MandatoryExtension. It cannot be used by a server. -or- code is CloseStatusCode.NoStatus and reason is specified. -or- reason could not be UTF-8-encoded.
ArgumentOutOfRangeExceptionThe size of reason is greater than 123 bytes.

◆ Close() [4/5]

void WebSocketSharp.WebSocket.Close ( ushort code)
inline

Closes the connection with the specified status code.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeA ushort that specifies the status code indicating the reason for the close. The status codes are defined in Section 7.4of RFC 6455.
例外
ArgumentExceptioncode is 1011 (server error). It cannot be used by a client. -or- code is 1010 (mandatory extension). It cannot be used by a server.
ArgumentOutOfRangeExceptioncode is less than 1000 or greater than 4999.

◆ Close() [5/5]

void WebSocketSharp.WebSocket.Close ( ushort code,
string reason )
inline

Closes the connection with the specified status code and reason.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeA ushort that specifies the status code indicating the reason for the close. The status codes are defined in Section 7.4of RFC 6455.
reasonA string that specifies the reason for the close. Its size must be 123 bytes or less in UTF-8.
例外
ArgumentExceptioncode is 1011 (server error). It cannot be used by a client. -or- code is 1010 (mandatory extension). It cannot be used by a server. -or- code is 1005 (no status) and reason is specified. -or- reason could not be UTF-8-encoded.
ArgumentOutOfRangeExceptioncode is less than 1000 or greater than 4999. -or- The size of reason is greater than 123 bytes.

◆ CloseAsync() [1/5]

void WebSocketSharp.WebSocket.CloseAsync ( )
inline

Closes the connection asynchronously.

This method does not wait for the close to be complete.

This method does nothing if the current state of the interface is Closing or Closed.

◆ CloseAsync() [2/5]

void WebSocketSharp.WebSocket.CloseAsync ( CloseStatusCode code)
inline

Closes the connection asynchronously with the specified status code.

This method does not wait for the close to be complete.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeOne of the CloseStatusCode enum values. It specifies the status code indicating the reason for the close.
例外
ArgumentExceptioncode is an undefined enum value. -or- code is CloseStatusCode.ServerError. It cannot be used by a client. -or- code is CloseStatusCode.MandatoryExtension. It cannot be used by a server.

◆ CloseAsync() [3/5]

void WebSocketSharp.WebSocket.CloseAsync ( CloseStatusCode code,
string reason )
inline

Closes the connection asynchronously with the specified status code and reason.

This method does not wait for the close to be complete.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeOne of the CloseStatusCode enum values. It specifies the status code indicating the reason for the close.
reasonA string that specifies the reason for the close. Its size must be 123 bytes or less in UTF-8.
例外
ArgumentExceptioncode is an undefined enum value. -or- code is CloseStatusCode.ServerError. It cannot be used by a client. -or- code is CloseStatusCode.MandatoryExtension. It cannot be used by a server. -or- code is CloseStatusCode.NoStatus and reason is specified. -or- reason could not be UTF-8-encoded.
ArgumentOutOfRangeExceptionThe size of reason is greater than 123 bytes.

◆ CloseAsync() [4/5]

void WebSocketSharp.WebSocket.CloseAsync ( ushort code)
inline

Closes the connection asynchronously with the specified status code.

This method does not wait for the close to be complete.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeA ushort that specifies the status code indicating the reason for the close. The status codes are defined in Section 7.4of RFC 6455.
例外
ArgumentExceptioncode is 1011 (server error). It cannot be used by a client. -or- code is 1010 (mandatory extension). It cannot be used by a server.
ArgumentOutOfRangeExceptioncode is less than 1000 or greater than 4999.

◆ CloseAsync() [5/5]

void WebSocketSharp.WebSocket.CloseAsync ( ushort code,
string reason )
inline

Closes the connection asynchronously with the specified status code and reason.

This method does not wait for the close to be complete.

This method does nothing if the current state of the interface is Closing or Closed.

引数
codeA ushort that specifies the status code indicating the reason for the close. The status codes are defined in Section 7.4of RFC 6455.
reasonA string that specifies the reason for the close. Its size must be 123 bytes or less in UTF-8.
例外
ArgumentExceptioncode is 1011 (server error). It cannot be used by a client. -or- code is 1010 (mandatory extension). It cannot be used by a server. -or- code is 1005 (no status) and reason is specified. -or- reason could not be UTF-8-encoded.
ArgumentOutOfRangeExceptioncode is less than 1000 or greater than 4999. -or- The size of reason is greater than 123 bytes.

◆ Connect()

void WebSocketSharp.WebSocket.Connect ( )
inline

Establishes a connection.

This method does nothing when the current state of the interface is Connecting or Open.

例外
InvalidOperationExceptionThe Connect method is not available if the interface is not for the client. -or- The Connect method is not available if a series of reconnecting has failed.

◆ ConnectAsync()

void WebSocketSharp.WebSocket.ConnectAsync ( )
inline

Establishes a connection asynchronously.

This method does not wait for the connect process to be complete.

This method does nothing when the current state of the interface is Connecting or Open.

例外
InvalidOperationExceptionThe ConnectAsync method is not available if the interface is not for the client. -or- The ConnectAsync method is not available if a series of reconnecting has failed.

◆ Ping() [1/2]

bool WebSocketSharp.WebSocket.Ping ( )
inline

Sends a ping to the remote endpoint.

戻り値
true if the send has successfully done and a pong has been received within a time; otherwise, false.

◆ Ping() [2/2]

bool WebSocketSharp.WebSocket.Ping ( string message)
inline

Sends a ping with the specified message to the remote endpoint.

戻り値
true if the send has successfully done and a pong has been received within a time; otherwise, false.
引数
messageA string that specifies the message to send. Its size must be 125 bytes or less in UTF-8.
例外
ArgumentExceptionmessage could not be UTF-8-encoded.
ArgumentOutOfRangeExceptionThe size of message is greater than 125 bytes.

◆ Send() [1/4]

void WebSocketSharp.WebSocket.Send ( byte[] data)
inline

Sends the specified data to the remote endpoint.

引数
dataAn array of byte that specifies the binary data to send.
例外
ArgumentNullExceptiondata is null.
InvalidOperationExceptionThe Send method is not available when the current state of the interface is not Open.

◆ Send() [2/4]

void WebSocketSharp.WebSocket.Send ( FileInfo fileInfo)
inline

Sends the specified file to the remote endpoint.

引数
fileInfoA FileInfo that specifies the file to send. The file is sent as the binary data.
例外
ArgumentExceptionThe file does not exist. -or- The file could not be opened.
ArgumentNullExceptionfileInfo is null.
InvalidOperationExceptionThe Send method is not available when the current state of the interface is not Open.

◆ Send() [3/4]

void WebSocketSharp.WebSocket.Send ( Stream stream,
int length )
inline

Sends the data from the specified stream instance to the remote endpoint.

引数
streamA Stream instance from which to read the data to send. The data is sent as the binary data.
lengthAn int that specifies the number of bytes to send.
例外
ArgumentExceptionstream cannot be read. -or- length is less than 1. -or- No data could be read from stream .
ArgumentNullExceptionstream is null.
InvalidOperationExceptionThe Send method is not available when the current state of the interface is not Open.

◆ Send() [4/4]

void WebSocketSharp.WebSocket.Send ( string data)
inline

Sends the specified data to the remote endpoint.

引数
dataA string that specifies the text data to send.
例外
ArgumentExceptiondata could not be UTF-8-encoded.
ArgumentNullExceptiondata is null.
InvalidOperationExceptionThe Send method is not available when the current state of the interface is not Open.

◆ SendAsync() [1/4]

void WebSocketSharp.WebSocket.SendAsync ( byte[] data,
Action< bool > completed )
inline

Sends the specified data to the remote endpoint asynchronously.

This method does not wait for the send to be complete.

引数
dataAn array of byte that specifies the binary data to send.
completedAn T:System.Action<bool> delegate. It specifies the delegate called when the send is complete. The bool parameter passed to the delegate is true if the send has successfully done; otherwise, false. null if not necessary.
例外
ArgumentNullExceptiondata is null.
InvalidOperationExceptionThe SendAsync method is not available when the current state of the interface is not Open.

◆ SendAsync() [2/4]

void WebSocketSharp.WebSocket.SendAsync ( FileInfo fileInfo,
Action< bool > completed )
inline

Sends the specified file to the remote endpoint asynchronously.

This method does not wait for the send to be complete.

引数
fileInfoA FileInfo that specifies the file to send. The file is sent as the binary data.
completedAn T:System.Action<bool> delegate. It specifies the delegate called when the send is complete. The bool parameter passed to the delegate is true if the send has successfully done; otherwise, false. null if not necessary.
例外
ArgumentExceptionThe file does not exist. -or- The file could not be opened.
ArgumentNullExceptionfileInfo is null.
InvalidOperationExceptionThe SendAsync method is not available when the current state of the interface is not Open.

◆ SendAsync() [3/4]

void WebSocketSharp.WebSocket.SendAsync ( Stream stream,
int length,
Action< bool > completed )
inline

Sends the data from the specified stream instance to the remote endpoint asynchronously.

This method does not wait for the send to be complete.

引数
streamA Stream instance from which to read the data to send. The data is sent as the binary data.
lengthAn int that specifies the number of bytes to send.
completedAn T:System.Action<bool> delegate. It specifies the delegate called when the send is complete. The bool parameter passed to the delegate is true if the send has successfully done; otherwise, false. null if not necessary.
例外
ArgumentExceptionstream cannot be read. -or- length is less than 1. -or- No data could be read from stream .
ArgumentNullExceptionstream is null.
InvalidOperationExceptionThe SendAsync method is not available when the current state of the interface is not Open.

◆ SendAsync() [4/4]

void WebSocketSharp.WebSocket.SendAsync ( string data,
Action< bool > completed )
inline

Sends the specified data to the remote endpoint asynchronously.

This method does not wait for the send to be complete.

引数
dataA string that specifies the text data to send.
completedAn T:System.Action<bool> delegate. It specifies the delegate called when the send is complete. The bool parameter passed to the delegate is true if the send has successfully done; otherwise, false. null if not necessary.
例外
ArgumentExceptiondata could not be UTF-8-encoded.
ArgumentNullExceptiondata is null.
InvalidOperationExceptionThe SendAsync method is not available when the current state of the interface is not Open.

◆ SetCookie()

void WebSocketSharp.WebSocket.SetCookie ( Cookie cookie)
inline

Sets an HTTP cookie to send with the handshake request or response.

引数
cookieA Cookie that specifies the cookie to send.
例外
ArgumentNullExceptioncookie is null.
InvalidOperationExceptionThe SetCookie method is not available when the current state of the interface is neither New nor Closed.

◆ SetCredentials()

void WebSocketSharp.WebSocket.SetCredentials ( string username,
string password,
bool preAuth )
inline

Sets the credentials for the HTTP authentication (Basic/Digest).

引数
usernameA string that specifies the username associated with the credentials. null or an empty string if initializes the credentials.
passwordA string that specifies the password for the username associated with the credentials. null or an empty string if not necessary.
preAuthA bool: true if sends the credentials for the Basic authentication in advance with the first handshake request; otherwise, false.
例外
ArgumentExceptionusername contains an invalid character. -or- password contains an invalid character.
InvalidOperationExceptionThe SetCredentials method is not available if the interface is not for the client. -or- The SetCredentials method is not available when the current state of the interface is neither New nor Closed.

◆ SetProxy()

void WebSocketSharp.WebSocket.SetProxy ( string url,
string username,
string password )
inline

Sets the URL of the HTTP proxy server through which to connect and the credentials for the HTTP proxy authentication (Basic/Digest).

引数
urlA string that specifies the URL of the proxy server through which to connect. The syntax is http://&lt;host&gt;[:<port>]. null or an empty string if initializes the URL and the credentials.
usernameA string that specifies the username associated with the credentials. null or an empty string if the credentials are not necessary.
passwordA string that specifies the password for the username associated with the credentials. null or an empty string if not necessary.
例外
ArgumentExceptionurl is not an absolute URI string. -or- The scheme of url is not http. -or- url includes the path segments. -or- username contains an invalid character. -or- password contains an invalid character.
InvalidOperationExceptionThe SetProxy method is not available if the interface is not for the client. -or- The SetProxy method is not available when the current state of the interface is neither New nor Closed.

◆ SetUserHeader()

void WebSocketSharp.WebSocket.SetUserHeader ( string name,
string value )
inline

Sets a user header to send with the handshake request or response.

引数
nameA string that specifies the name of the header to set.
valueA string that specifies the value of the header to set.
例外
ArgumentExceptionname is an empty string. -or- name is a string of spaces. -or- name contains an invalid character. -or- value contains an invalid character. -or- name is a restricted header name.
ArgumentNullExceptionname is null.
ArgumentOutOfRangeExceptionThe length of value is greater than 65,535 characters.
InvalidOperationExceptionThe SetUserHeader method is not available when the current state of the interface is neither New nor Closed. -or- The SetUserHeader method is not available if the interface does not allow the header type.

プロパティ詳解

◆ Compression

CompressionMethod WebSocketSharp.WebSocket.Compression
getset

Gets or sets the compression method used to compress a message.

One of the CompressionMethod enum values.

It indicates the compression method used to compress a message.

The default value is CompressionMethod.None.

例外
InvalidOperationExceptionThe set operation is not available if the interface is not for the client. -or- The set operation is not available when the current state of the interface is neither New nor Closed.

◆ Cookies

IEnumerable<Cookie> WebSocketSharp.WebSocket.Cookies
get

Gets the HTTP cookies included in the handshake request/response.

An T:System.Collections.Generic.IEnumerable<WebSocketSharp.Net.Cookie> instance.

It provides an enumerator which supports the iteration over the collection of the cookies.

◆ Credentials

NetworkCredential WebSocketSharp.WebSocket.Credentials
get

Gets the credentials for the HTTP authentication (Basic/Digest).

A NetworkCredential that represents the credentials used to authenticate the client.

The default value is null.

◆ EmitOnPing

bool WebSocketSharp.WebSocket.EmitOnPing
getset

Gets or sets a value indicating whether the interface emits the message event when it receives a ping.

true if the interface emits the message event when it receives a ping; otherwise, false.

The default value is false.

例外
InvalidOperationExceptionThe set operation is not available when the current state of the interface is neither New nor Closed.

◆ EnableRedirection

bool WebSocketSharp.WebSocket.EnableRedirection
getset

Gets or sets a value indicating whether the URL redirection for the handshake request is allowed.

true if the interface allows the URL redirection for the handshake request; otherwise, false.

The default value is false.

例外
InvalidOperationExceptionThe set operation is not available if the interface is not for the client. -or- The set operation is not available when the current state of the interface is neither New nor Closed.

◆ Extensions

string WebSocketSharp.WebSocket.Extensions
get

Gets the extensions selected by the server.

A string that represents a list of the extensions negotiated between the client and server.

An empty string if not specified or selected.

◆ HandshakeResponseHeaders

NameValueCollection WebSocketSharp.WebSocket.HandshakeResponseHeaders
get

Gets the HTTP headers included in the handshake response.

A NameValueCollection that contains the headers included in the handshake response.

例外
InvalidOperationExceptionThe get operation is not available if the interface is not for the client. -or- The get operation is not available when the current state of the interface is New or Connecting.

◆ IsAlive

bool WebSocketSharp.WebSocket.IsAlive
get

Gets a value indicating whether the communication is possible.

true if the communication is possible; otherwise, false.

◆ IsSecure

bool WebSocketSharp.WebSocket.IsSecure
get

Gets a value indicating whether the connection is secure.

true if the connection is secure; otherwise, false.

◆ Log

Logger WebSocketSharp.WebSocket.Log
getset

Gets the logging function.

The default logging level is LogLevel.Error.

A Logger that provides the logging function.

例外
InvalidOperationExceptionThe get operation is not available if the interface is not for the client.

◆ NoDelay

bool WebSocketSharp.WebSocket.NoDelay
getset

Gets or sets a value indicating whether the underlying TCP socket disables a delay when send or receive buffer is not full.

true if the delay is disabled; otherwise, false.

The default value is false.

参照
Socket.NoDelay
例外
InvalidOperationExceptionThe set operation is not available when the current state of the interface is neither New nor Closed.

◆ Origin

string WebSocketSharp.WebSocket.Origin
getset

Gets or sets the value of the HTTP Origin header to send with the handshake request.

The HTTP Origin header is defined in Section 7 of RFC 6454

.

The interface sends the Origin header if this property has any.

A string that represents the value of the Origin header to send.

The syntax is <scheme>://<host>[:<port>].

The default value is null.

例外
ArgumentExceptionThe value specified for a set operation is not an absolute URI string. -or- The value specified for a set operation includes the path segments.
InvalidOperationExceptionThe set operation is not available if the interface is not for the client. -or- The set operation is not available when the current state of the interface is neither New nor Closed.

◆ Protocol

string WebSocketSharp.WebSocket.Protocol
getset

Gets the name of subprotocol selected by the server.

A string that will be one of the names of subprotocols specified by client.

An empty string if not specified or selected.

◆ ReadyState

WebSocketState WebSocketSharp.WebSocket.ReadyState
get

Gets the current state of the interface.

One of the WebSocketState enum values.

It indicates the current state of the interface.

The default value is WebSocketState.New.

◆ SslConfiguration

ClientSslConfiguration WebSocketSharp.WebSocket.SslConfiguration
get

Gets the configuration for secure connection.

The configuration is used when the interface attempts to connect, so it must be configured before any connect method is called.

A ClientSslConfiguration that represents the configuration used to establish a secure connection.

例外
InvalidOperationExceptionThe get operation is not available if the interface is not for the client. -or- The get operation is not available if the interface does not use a secure connection.

◆ Url

Uri WebSocketSharp.WebSocket.Url
get

Gets the URL to which to connect.

A Uri that represents the URL to which to connect.

Also it represents the URL requested by the client if the interface is for the server.

◆ WaitTime

TimeSpan WebSocketSharp.WebSocket.WaitTime
getset

Gets or sets the time to wait for the response to the ping or close.

A TimeSpan that represents the time to wait for the response.

The default value is the same as 5 seconds if the interface is for the client.

例外
ArgumentOutOfRangeExceptionThe value specified for a set operation is zero or less.
InvalidOperationExceptionThe set operation is not available when the current state of the interface is neither New nor Closed.

このクラス詳解は次のファイルから抽出されました: