Provides a set of static methods for the websocket-sharp.
See Also: Inherited members from object.
static
|
AcceptWebSocket
(this System.Net.Sockets.TcpClient, bool)Accept a WebSocket connection by the System.Net.Sockets.TcpListener. |
|
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
|
Exists
(this System.Collections.Specialized.NameValueCollection, string)Determines whether the entry with the specified key exists in the specified System.Collections.Specialized.NameValueCollection. |
|
static
|
Exists
(this System.Collections.Specialized.NameValueCollection, string, string)Determines whether the entry with the specified both key and value exists in the specified System.Collections.Specialized.NameValueCollection. |
|
static
|
GetAbsolutePath
(this Uri)Gets the absolute path from the specified Uri. |
|
static
|
GetDescription
(this WebSocketSharp.Net.HttpStatusCode)Gets the description of the HTTP status code using the specified code. |
|
static
|
GetName
(this string, string)Gets the name from the specified string that contains a pair of name and value are 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 code. |
|
static
|
GetValue
(this string, string)Gets the value from the specified string that contains a pair of name and value are separated by a separator string. |
|
static
|
IsEmpty
(this string)Determines whether the specified string is a string.Empty. |
|
static
|
IsHostOrder
(this ByteOrder)Determines whether the specified WebSocketSharp.ByteOrder is host (this computer architecture) byte order. |
|
static
|
IsNull<T>
(this T)Determines whether the specified object is null. |
|
static
|
IsNullDo<T>
(this T, Action)Determines whether the specified object is null. And invokes the specified Action delegate if the specified object is null. |
|
static
|
IsNullOrEmpty
(this string)Determines whether the specified string is null or string.Empty. |
|
static
|
IsPredefinedScheme
(this string)Determines whether the specified string is predefined scheme. |
|
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
|
NotEqual
(this string, string, bool)Determines whether two specified string objects don't have the same value. |
|
static
|
ReadBytes
(this System.IO.Stream, int)Reads a block of bytes from the specified 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 stream and returns the read data in an array of byte. |
|
static
|
ReadBytes
(this System.IO.Stream, long, int)Reads a block of bytes from the specified 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<ulong>)Executes the specified Action<ulong> delegate n times. |
|
static
|
Times
(this long, Action)Executes the specified Action delegate n times. |
|
static
|
Times
(this long, Action<ulong>)Executes the specified Action<ulong> delegate n times. |
|
static
|
Times
(this uint, Action)Executes the specified Action delegate n times. |
|
static
|
Times
(this uint, Action<ulong>)Executes the specified Action<ulong> 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
|
ToBytes<T>
(this T, ByteOrder)Converts the specified data 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 concatenated the specified separator string between each element of this array. |
|
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. |
Accept a WebSocket connection by the System.Net.Sockets.TcpListener.
Syntax
public static WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext AcceptWebSocket (this System.Net.Sockets.TcpClient client, bool secure)Parameters
- client
- A System.Net.Sockets.TcpClient that contains a TCP connection to accept a WebSocket connection from.
- 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 Is thrown when the client 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)
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)
Determines whether the entry with the specified key exists in the specified System.Collections.Specialized.NameValueCollection.
Syntax
public static bool Exists (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 the entry with the name exists in the collection; 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 entry with the specified both key and value exists in the specified System.Collections.Specialized.NameValueCollection.
Syntax
public static bool Exists (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 the entry with the both name and value exists in the collection; otherwise, false.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 description of the HTTP status code using the specified code.
Syntax
public static string GetDescription (this WebSocketSharp.Net.HttpStatusCode code)Parameters
- code
- One of WebSocketSharp.Net.HttpStatusCode values that contains the HTTP status code.
Returns
A string that contains the description of the 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 are 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 code.
Syntax
Parameters
- code
- An int that contains the HTTP status code.
Returns
A string that contains the description of the 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 are 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 string is a string.Empty.
Syntax
Parameters
- value
- A string to test.
Returns
true if the value parameter is a string.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 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 object is null.
Syntax
public static bool IsNull<T> (this T obj)
where T : classType Parameters
- T
- The type of the obj parameter.
Parameters
- obj
- A class to test.
Returns
true if the obj parameter is null; 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 object is null. And invokes the specified Action delegate if the specified object is null.
Syntax
Type Parameters
- T
- The type of the obj parameter.
Parameters
- obj
- A class to test.
- act
- An Action delegate that contains the method(s) called if the obj is null.
Returns
true if the obj parameter is null; 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 null or string.Empty.
Syntax
Parameters
- value
- A string to test.
Returns
true if the value parameter is null or string.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 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)
Determines whether two specified string objects don't have the same value.
Syntax
Parameters
Returns
true if the value of expected parameter isn't the same as the value of actual parameter; 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 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 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)
Reads a block of bytes from the specified 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.
- bufferLength
- An int that contains the buffer size in bytes of each internal 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<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)
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)
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)
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 value. 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 the src.
Returns
A T converted from the src, or a default value of T if the src is an empty array of byte or if the types of T aren't the bool, char, double, float, int, long, short, uint, ulong, ushort.Exceptions
Type Reason ArgumentNullException Is thrown when the src 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)
Converts the specified data to an array of byte.
Syntax
Type Parameters
- T
- The type of the 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 the 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 the src.
Returns
An array of byte converted from the src.Exceptions
Type Reason ArgumentNullException Is thrown when the src 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)
Converts the specified array to a string concatenated the specified separator string between each element of this array.
Syntax
Type Parameters
- T
- The type of elements in the array.
Parameters
- array
- An array of T to convert.
- separator
- A string that contains a separator string.
Returns
A string converted from the array parameter, or a string.Empty if the length of the array is zero.Exceptions
Type Reason ArgumentNullException Is thrown when the array 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)
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)