websocket-sharp : WebSocketSharp Namespace

Ext Class

Provides a set of static methods for the websocket-sharp.

Syntax

public static class Ext

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Members

See Also: Inherited members from object.

Public Methods

static
AcceptWebSocket (this System.Net.Sockets.TcpListener, bool) : WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext
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) : bool
Determines whether the specified System.Collections.Specialized.NameValueCollection contains the entry with the specified name.
static
Contains (this string, params char[]) : bool
Determines whether the specified string contains any of characters in the specified array of char.
static
Contains (this System.Collections.Specialized.NameValueCollection, string, string) : bool
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>) : bool
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) : string
Gets the absolute path from the specified Uri.
static
GetCookies (this System.Collections.Specialized.NameValueCollection, bool) : WebSocketSharp.Net.CookieCollection
Gets the collection of cookies from the specified System.Collections.Specialized.NameValueCollection.
static
GetDescription (this WebSocketSharp.Net.HttpStatusCode) : string
Gets the description of the HTTP status code using the specified WebSocketSharp.Net.HttpStatusCode.
static
GetName (this string, 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) : KeyValuePair<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) : string
Gets the description of the HTTP status code using the specified int.
static
GetValue (this string, 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) : bool
Determines whether the specified ushort is in the allowable range of the WebSocket close status code.
static
IsEmpty (this string) : bool
Determines whether the specified string is empty.
static
IsEnclosedIn (this string, char) : bool
Determines whether the specified string is enclosed in the specified char.
static
IsHostOrder (this ByteOrder) : bool
Determines whether the specified WebSocketSharp.ByteOrder is host (this computer architecture) byte order.
static
IsLocal (this System.Net.IPAddress) : bool
Determines whether the specified System.Net.IPAddress represents a local IP address.
static
IsNullOrEmpty (this string) : bool
Determines whether the specified string is null or empty.
static
IsPredefinedScheme (this string) : bool
Determines whether the specified string is predefined scheme.
static
IsUpgradeTo (this WebSocketSharp.Net.HttpListenerRequest, string) : bool
Determines whether the specified WebSocketSharp.Net.HttpListenerRequest is the HTTP Upgrade request to switch to the specified protocol.
static
IsValidAbsolutePath (this string, out string) : bool
Determines whether the specified string is valid absolute path.
static
MaybeUri (this string) : bool
Determines whether the specified string is a URI string.
static
ReadBytes (this System.IO.Stream, int) : byte[]
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) : byte[]
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) : T[]
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) : T
Converts the specified array of byte to the specified type data.
static
ToByteArray<T> (this T, ByteOrder) : byte[]
Converts the specified value to an array of byte.
static
ToHostOrder (this byte[], ByteOrder) : byte[]
Converts the order of the specified array of byte to the host byte order.
static
ToString<T> (this T[], string) : string
Converts the specified array to a string that concatenates the each element of array across the specified separator.
static
ToUri (this string) : Uri
Converts the specified string to a Uri object.
static
TryCreateWebSocketUri (this string, out Uri, out string) : bool
Tries to create a new WebSocket Uri using the specified uriString.
static
UrlDecode (this string) : string
URL-decodes the specified string.
static
UrlEncode (this string) : string
URL-encodes the specified string.
static
WriteContent (this WebSocketSharp.Net.HttpListenerResponse, byte[])
Writes the specified content data using the specified WebSocketSharp.Net.HttpListenerResponse.

Member Details

AcceptWebSocket Method

Accepts a WebSocket connection by the System.Net.Sockets.TcpListener.

Syntax

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)

AcceptWebSocketAsync Method

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)

Contains Method

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)

Contains Method

Determines whether the specified string contains any of characters in the specified array of char.

Syntax

public static bool Contains (this string value, params char[] chars)

Parameters

value
A string to test.
chars
An array of char that contains characters to find.

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)

Contains Method

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 Method

Emit the specified EventHandler delegate if is not null.

Syntax

public static void Emit (this EventHandler eventHandler, object sender, EventArgs e)

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<TEventArgs> Generic Method

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 : EventArgs

Type 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)

EqualsAndSaveTo Method

Determines whether the specified int equals the specified char as byte. And save this specified int as byte to the specified List<byte>.

Syntax

public static bool EqualsAndSaveTo (this int value, char c, List<byte> dest)

Parameters

value
An int to compare.
c
A char to compare.
dest
A List<byte> to save the value as byte.

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)

GetAbsolutePath Method

Gets the absolute path from the specified Uri.

Syntax

public static string GetAbsolutePath (this Uri uri)

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)

GetCookies Method

Gets the collection of cookies from the specified System.Collections.Specialized.NameValueCollection.

Syntax

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)

GetDescription Method

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)

GetName Method

Gets the name from the specified string that contains a pair of name and value separated by a separator string.

Syntax

public static string GetName (this string nameAndValue, string separator)

Parameters

nameAndValue
A string that contains a pair of name and value separated by a separator string.
separator
A string that contains a separator string.

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)

GetNameAndValue Method

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

nameAndValue
A string that contains a pair of name and value are separated by a separator string.
separator
A string that contains a separator string.

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)

GetStatusDescription Method

Gets the description of the HTTP status code using the specified int.

Syntax

public static string GetStatusDescription (this int code)

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)

GetValue Method

Gets the value from the specified string that contains a pair of name and value separated by a separator string.

Syntax

public static string GetValue (this string nameAndValue, string separator)

Parameters

nameAndValue
A string that contains a pair of name and value separated by a separator string.
separator
A string that contains a separator string.

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)

IsCloseStatusCode Method

Determines whether the specified ushort is in the allowable range of the WebSocket close status code.

Syntax

public static bool IsCloseStatusCode (this ushort code)

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)

IsEmpty Method

Determines whether the specified string is empty.

Syntax

public static bool IsEmpty (this string value)

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)

IsEnclosedIn Method

Determines whether the specified string is enclosed in the specified char.

Syntax

public static bool IsEnclosedIn (this string value, char c)

Parameters

value
A string to test.
c
A char that contains character to find.

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)

IsHostOrder Method

Determines whether the specified WebSocketSharp.ByteOrder is host (this computer architecture) byte order.

Syntax

public static bool IsHostOrder (this ByteOrder order)

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)

IsLocal Method

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)

IsNullOrEmpty Method

Determines whether the specified string is null or empty.

Syntax

public static bool IsNullOrEmpty (this string value)

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)

IsPredefinedScheme Method

Determines whether the specified string is predefined scheme.

Syntax

public static bool IsPredefinedScheme (this string scheme)

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)

IsUpgradeTo Method

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)

IsValidAbsolutePath Method

Determines whether the specified string is valid absolute path.

Syntax

public static bool IsValidAbsolutePath (this string absPath, out string message)

Parameters

absPath
A string to test.
message
A string that receives a message if the absPath is invalid.

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)

MaybeUri Method

Determines whether the specified string is a URI string.

Syntax

public static bool MaybeUri (this string uriString)

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)

ReadBytes Method

Reads a block of bytes from the specified System.IO.Stream and returns the read data in an array of byte.

Syntax

public static byte[] ReadBytes (this System.IO.Stream stream, int length)

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)

ReadBytes Method

Reads a block of bytes from the specified System.IO.Stream and returns the read data in an array of byte.

Syntax

public static byte[] ReadBytes (this System.IO.Stream stream, long length)

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)

SubArray<T> Generic Method

Retrieves a sub-array from the specified array. A sub-array starts at the specified element position.

Syntax

public static T[] SubArray<T> (this T[] array, int startIndex, int length)

Type Parameters

T
The type of elements in the array.

Parameters

array
An array of T that contains the data to retrieve a sub-array.
startIndex
An int that contains the zero-based starting position of a sub-array in the array.
length
An int that contains the number of elements to retrieve a sub-array.

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)

Times Method

Executes the specified Action delegate n times.

Syntax

public static void Times (this int n, Action act)

Parameters

n
An int is the number of times to execute.
act
An Action delegate that references the method(s) to execute.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action<int> delegate n times.

Syntax

public static void Times (this int n, Action<int> act)

Parameters

n
An int is the number of times to execute.
act
An Action<int> delegate that references the method(s) to execute. An int parameter to pass to the method(s) is the zero-based count of iteration.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action delegate n times.

Syntax

public static void Times (this long n, Action act)

Parameters

n
A long is the number of times to execute.
act
An Action delegate that references the method(s) to execute.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action<long> delegate n times.

Syntax

public static void Times (this long n, Action<long> act)

Parameters

n
A long is the number of times to execute.
act
An Action<long> delegate that references the method(s) to execute. A long parameter to pass to the method(s) is the zero-based count of iteration.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action delegate n times.

Syntax

public static void Times (this uint n, Action act)

Parameters

n
A uint is the number of times to execute.
act
An Action delegate that references the method(s) to execute.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action<uint> delegate n times.

Syntax

public static void Times (this uint n, Action<uint> act)

Parameters

n
A uint is the number of times to execute.
act
An Action<uint> delegate that references the method(s) to execute. A uint parameter to pass to the method(s) is the zero-based count of iteration.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action delegate n times.

Syntax

public static void Times (this ulong n, Action act)

Parameters

n
A ulong is the number of times to execute.
act
An Action delegate that references the method(s) to execute.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

Times Method

Executes the specified Action<ulong> delegate n times.

Syntax

public static void Times (this ulong n, Action<ulong> act)

Parameters

n
A ulong is the number of times to execute.
act
An Action<ulong> delegate that references the method(s) to execute. A ulong parameter to pass to this method(s) is the zero-based count of iteration.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

To<T> Generic Method

Converts the specified array of byte to the specified type data.

Syntax

public static T To<T> (this byte[] src, ByteOrder srcOrder)
where T : struct

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)

ToByteArray<T> Generic Method

Converts the specified value to an array of byte.

Syntax

public static byte[] ToByteArray<T> (this T value, ByteOrder order)
where T : struct

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)

ToHostOrder Method

Converts the order of the specified array of byte to the host byte order.

Syntax

public static byte[] ToHostOrder (this byte[] src, ByteOrder srcOrder)

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)

ToString<T> Generic Method

Converts the specified array to a string that concatenates the each element of array across the specified separator.

Syntax

public static string ToString<T> (this T[] array, string separator)

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)

ToUri Method

Converts the specified string to a Uri object.

Syntax

public static Uri ToUri (this string uriString)

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)

TryCreateWebSocketUri Method

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)

UrlDecode Method

URL-decodes the specified string.

Syntax

public static string UrlDecode (this string s)

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)

UrlEncode Method

URL-encodes the specified string.

Syntax

public static string UrlEncode (this string s)

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)

WriteContent Method

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)