Provides a set of static methods for the websocket-sharp.
See Also: Inherited members from object.
static
|
AcceptWebSocket
(this System.Net.Sockets.TcpListener, bool)Accepts a WebSocket connection by the System.Net.Sockets.TcpListener. |
|
static
|
AcceptWebSocketAsync
(this System.Net.Sockets.TcpListener, bool, Action<WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext>)Accepts a WebSocket connection asynchronously by the System.Net.Sockets.TcpListener. |
|
static
|
Contains
(this System.Collections.Specialized.NameValueCollection, string)Determines whether the specified System.Collections.Specialized.NameValueCollection contains the entry with the specified name. |
|
static
|
Contains
(this string, params char[])Determines whether the specified string contains any of characters in the specified array of char. |
|
static
|
Contains
(this System.Collections.Specialized.NameValueCollection, string, string)Determines whether the specified System.Collections.Specialized.NameValueCollection contains the entry with the specified both name and value. |
|
static
|
Emit
(this EventHandler, object, EventArgs)Emit the specified EventHandler delegate if is not null. |
|
static
|
Emit<TEventArgs>
(this EventHandler<TEventArgs>, object, TEventArgs)Emit the specified EventHandler<TEventArgs> delegate if is not null. |
|
static
|
EqualsAndSaveTo
(this int, char, List<byte>)Determines whether the specified int equals the specified char as byte. And save this specified int as byte to the specified List<byte>. |
|
static
|
GetAbsolutePath
(this Uri)Gets the absolute path from the specified Uri. |
|
static
|
GetCookies
(this System.Collections.Specialized.NameValueCollection, bool)Gets the collection of cookies from the specified System.Collections.Specialized.NameValueCollection. |
|
static
|
GetDescription
(this WebSocketSharp.Net.HttpStatusCode)Gets the description of the HTTP status code using the specified WebSocketSharp.Net.HttpStatusCode. |
|
static
|
GetName
(this string, string)Gets the name from the specified string that contains a pair of name and value separated by a separator string. |
|
static
|
GetNameAndValue
(this string, string)Gets the name and value from the specified string that contains a pair of name and value are separated by a separator string. |
|
static
|
GetStatusDescription
(this int)Gets the description of the HTTP status code using the specified int. |
|
static
|
GetValue
(this string, string)Gets the value from the specified string that contains a pair of name and value separated by a separator string. |
|
static
|
IsCloseStatusCode
(this ushort)Determines whether the specified ushort is in the allowable range of the WebSocket close status code. |
|
static
|
IsEmpty
(this string)Determines whether the specified string is empty. |
|
static
|
IsEnclosedIn
(this string, char)Determines whether the specified string is enclosed in the specified char. |
|
static
|
IsHostOrder
(this ByteOrder)Determines whether the specified WebSocketSharp.ByteOrder is host (this computer architecture) byte order. |
|
static
|
IsLocal
(this System.Net.IPAddress)Determines whether the specified System.Net.IPAddress represents a local IP address. |
|
static
|
IsNullOrEmpty
(this string)Determines whether the specified string is null or empty. |
|
static
|
IsPredefinedScheme
(this string)Determines whether the specified string is predefined scheme. |
|
static
|
IsUpgradeTo
(this WebSocketSharp.Net.HttpListenerRequest, string)Determines whether the specified WebSocketSharp.Net.HttpListenerRequest is the HTTP Upgrade request to switch to the specified protocol. |
|
static
|
IsValidAbsolutePath
(this string, out string)Determines whether the specified string is valid absolute path. |
|
static
|
MaybeUri
(this string)Determines whether the specified string is a URI string. |
|
static
|
ReadBytes
(this System.IO.Stream, int)Reads a block of bytes from the specified System.IO.Stream and returns the read data in an array of byte. |
|
static
|
ReadBytes
(this System.IO.Stream, long)Reads a block of bytes from the specified System.IO.Stream and returns the read data in an array of byte. |
|
static
|
SubArray<T>
(this T[], int, int)Retrieves a sub-array from the specified array. A sub-array starts at the specified element position. |
|
static
|
Times
(this int, Action)Executes the specified Action delegate n times. |
|
static
|
Times
(this int, Action<int>)Executes the specified Action<int> delegate n times. |
|
static
|
Times
(this long, Action)Executes the specified Action delegate n times. |
|
static
|
Times
(this long, Action<long>)Executes the specified Action<long> delegate n times. |
|
static
|
Times
(this uint, Action)Executes the specified Action delegate n times. |
|
static
|
Times
(this uint, Action<uint>)Executes the specified Action<uint> delegate n times. |
|
static
|
Times
(this ulong, Action)Executes the specified Action delegate n times. |
|
static
|
Times
(this ulong, Action<ulong>)Executes the specified Action<ulong> delegate n times. |
|
static
|
To<T>
(this byte[], ByteOrder)Converts the specified array of byte to the specified type data. |
|
static
|
ToByteArray<T>
(this T, ByteOrder)Converts the specified value to an array of byte. |
|
static
|
ToHostOrder
(this byte[], ByteOrder)Converts the order of the specified array of byte to the host byte order. |
|
static
|
ToString<T>
(this T[], string)Converts the specified array to a string that concatenates the each element of array across the specified separator. |
|
static
|
ToUri
(this string)Converts the specified string to a Uri object. |
|
static
|
TryCreateWebSocketUri
(this string, out Uri, out string)Tries to create a new WebSocket Uri using the specified uriString. |
|
static
|
UrlDecode
(this string)URL-decodes the specified string. |
|
static
|
UrlEncode
(this string)URL-encodes the specified string. |
|
static
|
WriteContent
(this WebSocketSharp.Net.HttpListenerResponse, byte[])Writes the specified content data using the specified WebSocketSharp.Net.HttpListenerResponse. |
Accepts a WebSocket connection by the System.Net.Sockets.TcpListener.
Syntax
public static WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext AcceptWebSocket (this System.Net.Sockets.TcpListener listener, bool secure)Parameters
- listener
- A System.Net.Sockets.TcpListener that provides a TCP connection to accept a WebSocket connection.
- secure
- A bool that indicates a secure connection or not. (true indicates a secure connection.)
Returns
A WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext that contains a WebSocket connection.Exceptions
Type Reason ArgumentNullException listener is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Accepts a WebSocket connection asynchronously by the System.Net.Sockets.TcpListener.
Syntax
public static void AcceptWebSocketAsync (this System.Net.Sockets.TcpListener listener, bool secure, Action<WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext> completed)Parameters
- listener
- A System.Net.Sockets.TcpListener that provides a TCP connection to accept a WebSocket connection.
- secure
- A bool that indicates a secure connection or not. (true indicates a secure connection.)
- completed
- An Action<TcpListenerWebSocketContext> delegate that contains the method(s) that is called when an asynchronous operation completes.
Exceptions
Type Reason ArgumentNullException listener is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified System.Collections.Specialized.NameValueCollection contains the entry with the specified name.
Syntax
public static bool Contains (this System.Collections.Specialized.NameValueCollection collection, string name)Parameters
- collection
- A System.Collections.Specialized.NameValueCollection that contains the entries.
- name
- A string that contains the key of the entry to find.
Returns
true if collection contains the entry with name; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string contains any of characters in the specified array of char.
Syntax
Parameters
Returns
true if value contains any of chars; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified System.Collections.Specialized.NameValueCollection contains the entry with the specified both name and value.
Syntax
public static bool Contains (this System.Collections.Specialized.NameValueCollection collection, string name, string value)Parameters
- collection
- A System.Collections.Specialized.NameValueCollection that contains the entries.
- name
- A string that contains the key of the entry to find.
- value
- A string that contains the value of the entry to find.
Returns
true if collection contains the entry with both name and value; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Emit the specified EventHandler delegate if is not null.
Syntax
Parameters
- eventHandler
- An EventHandler to emit.
- sender
- An object that emits the eventHandler.
- e
- An EventArgs that contains no event data.
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Emit the specified EventHandler<TEventArgs> delegate if is not null.
Syntax
public static void Emit<TEventArgs> (this EventHandler<TEventArgs> eventHandler, object sender, TEventArgs e)
where TEventArgs : EventArgsType Parameters
- TEventArgs
- The type of the event data generated by the event.
Parameters
- eventHandler
- An EventHandler<TEventArgs> to emit.
- sender
- An object that emits the eventHandler.
- e
- A TEventArgs that contains the event data.
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified int equals the specified char as byte. And save this specified int as byte to the specified List<byte>.
Syntax
Parameters
Returns
true if the value parameter equals the c parameter as byte; otherwise, false.Exceptions
Type Reason ArgumentOutOfRangeException Is thrown when the value parameter passed to a method is invalid because it is outside the allowable range of values as byte. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the absolute path from the specified Uri.
Syntax
Parameters
- uri
- A Uri that contains the URI to get the absolute path from.
Returns
A string that contains the absolute path if got successfully; otherwise, null.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the collection of cookies from the specified System.Collections.Specialized.NameValueCollection.
Syntax
public static WebSocketSharp.Net.CookieCollection GetCookies (this System.Collections.Specialized.NameValueCollection headers, bool response)Parameters
- headers
- A System.Collections.Specialized.NameValueCollection that contains a collection of the HTTP Headers.
- response
- true if gets from the response headers; from the request headers, false.
Returns
A WebSocketSharp.Net.CookieCollection that receives a collection of the HTTP Cookies.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the description of the HTTP status code using the specified WebSocketSharp.Net.HttpStatusCode.
Syntax
public static string GetDescription (this WebSocketSharp.Net.HttpStatusCode code)Parameters
- code
- One of WebSocketSharp.Net.HttpStatusCode values that contains an HTTP status code.
Returns
A string that contains the description of the HTTP status code.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the name from the specified string that contains a pair of name and value separated by a separator string.
Syntax
Parameters
Returns
A string that contains the name if any; otherwise, null.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the name and value from the specified string that contains a pair of name and value are separated by a separator string.
Syntax
public static KeyValuePair<string, string> GetNameAndValue (this string nameAndValue, string separator)Parameters
Returns
A KeyValuePair<string, string> that contains the name and value if any.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the description of the HTTP status code using the specified int.
Syntax
Parameters
- code
- An int that contains an HTTP status code.
Returns
A string that contains the description of the HTTP status code.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Gets the value from the specified string that contains a pair of name and value separated by a separator string.
Syntax
Parameters
Returns
A string that contains the value if any; otherwise, null.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified ushort is in the allowable range of the WebSocket close status code.
Syntax
Parameters
- code
- A ushort to test.
Returns
true if code is in the allowable range of the WebSocket close status code; otherwise, false.Remarks
Not allowable ranges are the followings.
- Numbers in the range 0-999 are not used.
- Numbers which are greater than 4999 are out of the reserved close status code ranges.
Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string is empty.
Syntax
Parameters
- value
- A string to test.
Returns
true if value is empty; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string is enclosed in the specified char.
Syntax
Parameters
Returns
true if value is enclosed in c; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified WebSocketSharp.ByteOrder is host (this computer architecture) byte order.
Syntax
Parameters
- order
- A WebSocketSharp.ByteOrder to test.
Returns
true if the order parameter is host byte order; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified System.Net.IPAddress represents a local IP address.
Syntax
public static bool IsLocal (this System.Net.IPAddress address)Parameters
- address
- A System.Net.IPAddress to test.
Returns
true if address represents a local IP address; otherwise, false.Exceptions
Type Reason ArgumentNullException address is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string is null or empty.
Syntax
Parameters
- value
- A string to test.
Returns
true if the value parameter is null or empty; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string is predefined scheme.
Syntax
Parameters
- scheme
- A string to test.
Returns
true if the scheme parameter is the predefined scheme; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified WebSocketSharp.Net.HttpListenerRequest is the HTTP Upgrade request to switch to the specified protocol.
Syntax
public static bool IsUpgradeTo (this WebSocketSharp.Net.HttpListenerRequest request, string protocol)Parameters
- request
- A WebSocketSharp.Net.HttpListenerRequest that contains an HTTP request information.
- protocol
- A string that contains a protocol name.
Returns
true if the specified WebSocketSharp.Net.HttpListenerRequest is the HTTP Upgrade request to switch to the specified protocol; otherwise, false.Exceptions
Type Reason ArgumentNullException request is null.
-or-
protocol is null.
ArgumentException protocol is string.Empty. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string is valid absolute path.
Syntax
Parameters
Returns
true if the absPath parameter is valid absolute path; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Determines whether the specified string is a URI string.
Syntax
Parameters
- uriString
- A string to test.
Returns
true if the uriString parameter is maybe a URI string; otherwise, false.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Reads a block of bytes from the specified System.IO.Stream and returns the read data in an array of byte.
Syntax
Parameters
- stream
- A System.IO.Stream that contains the data to read.
- length
- An int that contains the number of bytes to read.
Returns
An array of byte that receives the read data.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Reads a block of bytes from the specified System.IO.Stream and returns the read data in an array of byte.
Syntax
Parameters
- stream
- A System.IO.Stream that contains the data to read.
- length
- A long that contains the number of bytes to read.
Returns
An array of byte that receives the read data.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Retrieves a sub-array from the specified array. A sub-array starts at the specified element position.
Syntax
Type Parameters
- T
- The type of elements in the array.
Parameters
Returns
An array of T that receives a sub-array, or an empty array of T if any problems with the parameters.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action<int> delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action<long> delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action<uint> delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Executes the specified Action<ulong> delegate n times.
Syntax
Parameters
Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Converts the specified array of byte to the specified type data.
Syntax
Type Parameters
- T
- The type of the return. The T must be a value type.
Parameters
- src
- An array of byte to convert.
- srcOrder
- A WebSocketSharp.ByteOrder that indicates the byte order of src.
Returns
A T converted from src, or a default value of T if src is an empty array of byte or if the type of T isn't bool, char, double, float, int, long, short, uint, ulong or ushort.Exceptions
Type Reason ArgumentNullException src is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Converts the specified value to an array of byte.
Syntax
Type Parameters
- T
- The type of value. The T must be a value type.
Parameters
- value
- A T to convert.
- order
- A WebSocketSharp.ByteOrder that indicates the byte order of the return.
Returns
An array of byte converted from value.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Converts the order of the specified array of byte to the host byte order.
Syntax
Parameters
- src
- An array of byte to convert.
- srcOrder
- A WebSocketSharp.ByteOrder that indicates the byte order of src.
Returns
An array of byte converted from src.Exceptions
Type Reason ArgumentNullException src is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Converts the specified array to a string that concatenates the each element of array across the specified separator.
Syntax
Type Parameters
- T
- The type of elements in array.
Parameters
- array
- An array of T to convert.
- separator
- A string that contains a separator string.
Returns
A string converted from array, or a string.Empty if the length of array is zero.Exceptions
Type Reason ArgumentNullException array is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Converts the specified string to a Uri object.
Syntax
Parameters
- uriString
- A string to convert.
Returns
A Uri converted from the uriString parameter, or null if the uriString is null or string.Empty.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Tries to create a new WebSocket Uri using the specified uriString.
Syntax
public static bool TryCreateWebSocketUri (this string uriString, out Uri result, out string message)Parameters
- uriString
- A string that contains a WebSocket URI.
- result
- When this method returns, contains a created WebSocket Uri if the uriString parameter is valid WebSocket URI; otherwise, null.
- message
- When this method returns, contains a error message string if the uriString parameter is invalid WebSocket URI; otherwise, String.Empty.
Returns
true if the WebSocket Uri was successfully created; otherwise, false.Exceptions
Type Reason ArgumentNullException Is thrown when the uriString parameter passed to a method is invalid because it is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
URL-decodes the specified string.
Syntax
Parameters
- s
- A string to decode.
Returns
A string that receives a decoded string, or the s parameter if the s is null or string.Empty.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
URL-encodes the specified string.
Syntax
Parameters
- s
- A string to encode.
Returns
A string that receives a encoded string, or the s parameter if the s is null or string.Empty.Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)
Writes the specified content data using the specified WebSocketSharp.Net.HttpListenerResponse.
Syntax
public static void WriteContent (this WebSocketSharp.Net.HttpListenerResponse response, byte[] content)Parameters
- response
- A WebSocketSharp.Net.HttpListenerResponse that contains a network stream to write a content data.
- content
- An array of byte that contains a content data to write.
Exceptions
Type Reason ArgumentNullException Is thrown when the response parameter passed to a method is invalid because it is null. Remarks
Documentation for this section has not yet been entered.Requirements
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)