websocket-sharp
Specifies the byte order.
Specifies Little-endian.
Specifies Big-endian.
Represents the event data for the event.
That event occurs when the WebSocket connection has been closed.
If you would like to get the reason for the close, you should access
the or property.
Gets the status code for the close.
A that represents the status code for the close if any.
Gets the reason for the close.
A that represents the reason for the close if any.
Gets a value indicating whether the connection has been closed cleanly.
true if the connection has been closed cleanly; otherwise, false.
Indicates the status code for the WebSocket connection close.
The values of this enumeration are defined in
Section 7.4 of RFC 6455.
"Reserved value" cannot be sent as a status code in
closing handshake by an endpoint.
Equivalent to close status 1000. Indicates normal close.
Equivalent to close status 1001. Indicates that an endpoint is
going away.
Equivalent to close status 1002. Indicates that an endpoint is
terminating the connection due to a protocol error.
Equivalent to close status 1003. Indicates that an endpoint is
terminating the connection because it has received a type of
data that it cannot accept.
Equivalent to close status 1004. Still undefined. A Reserved value.
Equivalent to close status 1005. Indicates that no status code was
actually present. A Reserved value.
Equivalent to close status 1006. Indicates that the connection was
closed abnormally. A Reserved value.
Equivalent to close status 1007. Indicates that an endpoint is
terminating the connection because it has received a message that
contains data that is not consistent with the type of the message.
Equivalent to close status 1008. Indicates that an endpoint is
terminating the connection because it has received a message that
violates its policy.
Equivalent to close status 1009. Indicates that an endpoint is
terminating the connection because it has received a message that
is too big to process.
Equivalent to close status 1010. Indicates that a client is
terminating the connection because it has expected the server to
negotiate one or more extension, but the server did not return
them in the handshake response.
Equivalent to close status 1011. Indicates that a server is
terminating the connection because it has encountered an unexpected
condition that prevented it from fulfilling the request.
Equivalent to close status 1015. Indicates that the connection was
closed due to a failure to perform a TLS handshake. A Reserved value.
Specifies the method for compression.
The methods are defined in
Compression Extensions for WebSocket.
Specifies no compression.
Specifies DEFLATE.
Represents the event data for the event.
That event occurs when the gets an error.
If you would like to get the error message, you should access
the property.
And if the error is due to an exception, you can get it by accessing
the property.
Gets the exception that caused the error.
An instance that represents the cause of
the error if it is due to an exception; otherwise, .
Gets the error message.
A that represents the error message.
Provides a set of static methods for websocket-sharp.
Determines whether the specified equals the specified ,
and invokes the specified Action<int> delegate at the same time.
true if equals ;
otherwise, false.
An to compare.
A to compare.
An Action<int> delegate that references the method(s) called
at the same time as comparing. An parameter to pass to
the method(s) is .
Gets the absolute path from the specified .
A that represents the absolute path if it's successfully found;
otherwise, .
A that represents the URI to get the absolute path from.
Gets the name from the specified that contains a pair of name and
value separated by a separator character.
A that represents the name if any; otherwise, null.
A that contains a pair of name and value separated by
a separator character.
A that represents the separator character.
Gets the value from the specified that contains a pair of name and
value separated by a separator character.
A that represents the value if any; otherwise, null.
A that contains a pair of name and value separated by
a separator character.
A that represents the separator character.
Tries to create a new for WebSocket with
the specified .
true if the was successfully created;
otherwise, false.
A that represents a WebSocket URL to try.
When this method returns, a that
represents the WebSocket URL or
if is invalid.
When this method returns, a that
represents an error message or
if is valid.
Determines whether the specified contains any of characters in
the specified array of .
true if contains any of ;
otherwise, false.
A to test.
An array of that contains characters to find.
Determines whether the specified contains
the entry with the specified .
true if contains the entry with
; otherwise, false.
A to test.
A that represents the key of the entry to find.
Determines whether the specified contains the entry with
the specified both and .
true if contains the entry with both
and ; otherwise, false.
A to test.
A that represents the key of the entry to find.
A that represents the value of the entry to find.
Emits the specified delegate if it isn't .
A to emit.
An from which emits this .
A that contains no event data.
Emits the specified EventHandler<TEventArgs> delegate if it isn't
.
An EventHandler<TEventArgs> to emit.
An from which emits this .
A TEventArgs that represents the event data.
The type of the event data generated by the event.
Gets the collection of the HTTP cookies from the specified HTTP .
A that receives a collection of the HTTP cookies.
A that contains a collection of the HTTP headers.
true if is a collection of the response headers;
otherwise, false.
Gets the description of the specified HTTP status .
A that represents the description of the HTTP status code.
One of enum values, indicates the HTTP status code.
Gets the description of the specified HTTP status .
A that represents the description of the HTTP status code.
An that represents the HTTP status code.
Determines whether the specified is in the
range of the status code for the WebSocket connection close.
The ranges are the following:
-
1000-2999: These numbers are reserved for definition by
the WebSocket protocol.
-
3000-3999: These numbers are reserved for use by libraries,
frameworks, and applications.
-
4000-4999: These numbers are reserved for private use.
true if is in the range of
the status code for the close; otherwise, false.
A to test.
Determines whether the specified is
enclosed in the specified .
true if is enclosed in
; otherwise, false.
A to test.
A to find.
Determines whether the specified is host (this computer
architecture) byte order.
true if is host byte order; otherwise, false.
One of the enum values, to test.
Determines whether the specified
represents a local IP address.
This local means NOT REMOTE for the current host.
true if represents a local IP address;
otherwise, false.
A to test.
Determines whether the specified string is or
an empty string.
true if the string is or an empty string;
otherwise, false.
A to test.
Determines whether the specified is
a predefined scheme.
true if is a predefined scheme;
otherwise, false.
A to test.
Determines whether the specified is
an HTTP Upgrade request to switch to the specified .
true if is an HTTP Upgrade request to switch to
; otherwise, false.
A that represents the HTTP request.
A that represents the protocol name.
is .
-or-
is .
is empty.
Determines whether the specified is a URI string.
true if may be a URI string;
otherwise, false.
A to test.
Retrieves a sub-array from the specified . A sub-array starts at
the specified element position in .
An array of T that receives a sub-array, or an empty array of T if any problems with
the parameters.
An array of T from which to retrieve a sub-array.
An that represents the zero-based starting position of
a sub-array in .
An that represents the number of elements to retrieve.
The type of elements in .
Retrieves a sub-array from the specified . A sub-array starts at
the specified element position in .
An array of T that receives a sub-array, or an empty array of T if any problems with
the parameters.
An array of T from which to retrieve a sub-array.
A that represents the zero-based starting position of
a sub-array in .
A that represents the number of elements to retrieve.
The type of elements in .
Executes the specified delegate times.
An is the number of times to execute.
An delegate that references the method(s) to execute.
Executes the specified delegate times.
A is the number of times to execute.
An delegate that references the method(s) to execute.
Executes the specified delegate times.
A is the number of times to execute.
An delegate that references the method(s) to execute.
Executes the specified delegate times.
A is the number of times to execute.
An delegate that references the method(s) to execute.
Executes the specified Action<int> delegate times.
An is the number of times to execute.
An Action<int> delegate that references the method(s) to execute.
An parameter to pass to the method(s) is the zero-based count of
iteration.
Executes the specified Action<long> delegate times.
A is the number of times to execute.
An Action<long> delegate that references the method(s) to execute.
A parameter to pass to the method(s) is the zero-based count of
iteration.
Executes the specified Action<uint> delegate times.
A is the number of times to execute.
An Action<uint> delegate that references the method(s) to execute.
A parameter to pass to the method(s) is the zero-based count of
iteration.
Executes the specified Action<ulong> delegate times.
A is the number of times to execute.
An Action<ulong> delegate that references the method(s) to execute.
A parameter to pass to this method(s) is the zero-based count of
iteration.
Converts the specified array of to the specified type data.
A T converted from , or a default value of
T if is an empty array of or
if the type of T isn't , , ,
, , , ,
, , or .
An array of to convert.
One of the enum values, specifies the byte order of
.
The type of the return. The T must be a value type.
is .
Converts the specified to an array of .
An array of converted from .
A T to convert.
One of the enum values, specifies the byte order of the return.
The type of . The T must be a value type.
Converts the order of the specified array of to the host byte order.
An array of converted from .
An array of to convert.
One of the enum values, specifies the byte order of
.
is .
Converts the specified to a that
concatenates the each element of across the specified
.
A converted from ,
or if is empty.
An array of T to convert.
A that represents the separator string.
The type of elements in .
is .
Converts the specified to a .
A converted from or
if the convert has failed.
A to convert.
URL-decodes the specified .
A that receives the decoded string or
if it is or empty.
A to decode.
URL-encodes the specified .
A that receives the encoded string or
if it is or empty.
A to encode.
Writes and sends the specified data with the specified
.
A that represents the HTTP response used to
send the content data.
An array of that represents the content data to send.
is .
-or-
is .
Indicates whether a WebSocket frame is the final frame of a message.
The values of this enumeration are defined in
Section 5.2 of RFC 6455.
Equivalent to numeric value 0. Indicates more frames of a message follow.
Equivalent to numeric value 1. Indicates the final frame of a message.
Represents a log data used by the class.
Gets the information of the logging method caller.
A that provides the information of the logging method caller.
Gets the date and time when the log data was created.
A that represents the date and time when the log data was created.
Gets the logging level of the log data.
One of the enum values, indicates the logging level of the log data.
Gets the message of the log data.
A that represents the message of the log data.
Returns a that represents the current .
A that represents the current .
Provides a set of methods and properties for logging.
If you output a log with lower than the value of the property,
it cannot be outputted.
The default output action writes a log to the standard output stream and the log file
if the property has a valid path to it.
If you would like to use the custom output action, you should set
the property to any Action<LogData, string>
delegate.
Initializes a new instance of the class.
This constructor initializes the current logging level with .
Initializes a new instance of the class with
the specified logging .
One of the enum values.
Initializes a new instance of the class with
the specified logging , path to the log ,
and action.
One of the enum values.
A that represents the path to the log file.
An Action<LogData, string> delegate that references the method(s) used to
output a log. A parameter passed to this delegate is
.
Gets or sets the current path to the log file.
A that represents the current path to the log file if any.
Gets or sets the current logging level.
A log with lower than the value of this property cannot be outputted.
One of the enum values, specifies the current logging level.
Gets or sets the current output action used to output a log.
An Action<LogData, string> delegate that references the method(s) used to
output a log. A parameter passed to this delegate is the value of
the property.
If the value to set is , the current output action is changed to
the default output action.
Outputs as a log with .
If the current logging level is higher than ,
this method doesn't output as a log.
A that represents the message to output as a log.
Outputs as a log with .
If the current logging level is higher than ,
this method doesn't output as a log.
A that represents the message to output as a log.
Outputs as a log with .
A that represents the message to output as a log.
Outputs as a log with .
If the current logging level is higher than ,
this method doesn't output as a log.
A that represents the message to output as a log.
Outputs as a log with .
If the current logging level is higher than ,
this method doesn't output as a log.
A that represents the message to output as a log.
Outputs as a log with .
If the current logging level is higher than ,
this method doesn't output as a log.
A that represents the message to output as a log.
Specifies the logging level.
Specifies the bottom logging level.
Specifies the 2nd logging level from the bottom.
Specifies the 3rd logging level from the bottom.
Specifies the 3rd logging level from the top.
Specifies the 2nd logging level from the top.
Specifies the top logging level.
Indicates whether the payload data of a WebSocket frame is masked.
The values of this enumeration are defined in
Section 5.2 of RFC 6455.
Equivalent to numeric value 0. Indicates not masked.
Equivalent to numeric value 1. Indicates masked.
Represents the event data for the event.
That event occurs when the receives
a message or a ping if the
property is set to true.
If you would like to get the message data, you should access
the or property.
Gets the opcode for the message.
, ,
or .
Gets the message data as a .
A that represents the message data if its type is
text or ping and if decoding it to a string has successfully done;
otherwise, .
Gets a value indicating whether the message type is binary.
true if the message type is binary; otherwise, false.
Gets a value indicating whether the message type is ping.
true if the message type is ping; otherwise, false.
Gets a value indicating whether the message type is text.
true if the message type is text; otherwise, false.
Gets the message data as an array of .
An array of that represents the message data.
Specifies the scheme for authentication.
No authentication is allowed.
Specifies digest authentication.
Specifies basic authentication.
Specifies anonymous authentication.
Stores the parameters for the used by clients.
Initializes a new instance of the class.
Initializes a new instance of the class
with the specified .
A that represents the target host server name.
Copies the parameters from the specified to
a new instance of the class.
A from which to copy.
is .
Gets or sets a value indicating whether the certificate revocation
list is checked during authentication.
true if the certificate revocation list is checked during
authentication; otherwise, false.
The default value is false.
Gets or sets the certificates from which to select one to
supply to the server.
A or .
That collection contains client certificates from which to select.
The default value is .
Gets or sets the callback used to select the certificate to
supply to the server.
No certificate is supplied if the callback returns
.
A delegate that
invokes the method called for selecting the certificate.
The default value is a delegate that invokes a method that
only returns .
Gets or sets the protocols used for authentication.
The enum values that represent
the protocols used for authentication.
The default value is .
Gets or sets the callback used to validate the certificate
supplied by the server.
The certificate is valid if the callback returns true.
A delegate that
invokes the method called for validating the certificate.
The default value is a delegate that invokes a method that
only returns true.
Gets or sets the target host server name.
A or
if not specified.
That string represents the name of the server that
will share a secure connection with a client.
Provides a set of methods and properties used to manage an HTTP Cookie.
The Cookie class supports the following cookie formats:
Netscape specification,
RFC 2109, and
RFC 2965
The Cookie class cannot be inherited.
Initializes a new instance of the class.
Initializes a new instance of the class with the specified
and .
A that represents the Name of the cookie.
A that represents the Value of the cookie.
is or empty.
- or -
contains an invalid character.
- or -
is .
- or -
contains a string not enclosed in double quotes
that contains an invalid character.
Initializes a new instance of the class with the specified
, , and .
A that represents the Name of the cookie.
A that represents the Value of the cookie.
A that represents the value of the Path attribute of the cookie.
is or empty.
- or -
contains an invalid character.
- or -
is .
- or -
contains a string not enclosed in double quotes
that contains an invalid character.
Initializes a new instance of the class with the specified
, , , and
.
A that represents the Name of the cookie.
A that represents the Value of the cookie.
A that represents the value of the Path attribute of the cookie.
A that represents the value of the Domain attribute of the cookie.
is or empty.
- or -
contains an invalid character.
- or -
is .
- or -
contains a string not enclosed in double quotes
that contains an invalid character.
Gets or sets the value of the Comment attribute of the cookie.
A that represents the comment to document intended use of the cookie.
Gets or sets the value of the CommentURL attribute of the cookie.
A that represents the URI that provides the comment to document intended
use of the cookie.
Gets or sets a value indicating whether the client discards the cookie unconditionally
when the client terminates.
true if the client discards the cookie unconditionally when the client terminates;
otherwise, false. The default value is false.
Gets or sets the value of the Domain attribute of the cookie.
A that represents the URI for which the cookie is valid.
Gets or sets a value indicating whether the cookie has expired.
true if the cookie has expired; otherwise, false.
The default value is false.
Gets or sets the value of the Expires attribute of the cookie.
A that represents the date and time at which the cookie expires.
The default value is .
Gets or sets a value indicating whether non-HTTP APIs can access the cookie.
true if non-HTTP APIs cannot access the cookie; otherwise, false.
The default value is false.
Gets or sets the Name of the cookie.
A that represents the Name of the cookie.
The value specified for a set operation is or empty.
- or -
The value specified for a set operation contains an invalid character.
Gets or sets the value of the Path attribute of the cookie.
A that represents the subset of URI on the origin server
to which the cookie applies.
Gets or sets the value of the Port attribute of the cookie.
A that represents the list of TCP ports to which the cookie applies.
The value specified for a set operation isn't enclosed in double quotes or
couldn't be parsed.
Gets or sets a value indicating whether the security level of the cookie is secure.
When this property is true, the cookie may be included in the HTTP request
only if the request is transmitted over the HTTPS.
true if the security level of the cookie is secure; otherwise, false.
The default value is false.
Gets the time when the cookie was issued.
A that represents the time when the cookie was issued.
Gets or sets the Value of the cookie.
A that represents the Value of the cookie.
The value specified for a set operation is .
- or -
The value specified for a set operation contains a string not enclosed in double quotes
that contains an invalid character.
Gets or sets the value of the Version attribute of the cookie.
An that represents the version of the HTTP state management
to which the cookie conforms.
The value specified for a set operation isn't 0 or 1.
Determines whether the specified is equal to the current
.
An to compare with the current .
true if is equal to the current ;
otherwise, false.
Serves as a hash function for a object.
An that represents the hash code for the current .
Returns a that represents the current .
This method returns a to use to send an HTTP Cookie to
an origin server.
A that represents the current .
Provides a collection container for instances of the class.
Initializes a new instance of the class.
Gets the number of cookies in the collection.
An that represents the number of cookies in the collection.
Gets a value indicating whether the collection is read-only.
true if the collection is read-only; otherwise, false.
The default value is true.
Gets a value indicating whether the access to the collection is thread safe.
true if the access to the collection is thread safe; otherwise, false.
The default value is false.
Gets the at the specified from
the collection.
A at the specified in the collection.
An that represents the zero-based index of the
to find.
is out of allowable range of indexes for the collection.
Gets the with the specified from
the collection.
A with the specified in the collection.
A that represents the name of the to find.
is .
Gets an object used to synchronize access to the collection.
An used to synchronize access to the collection.
Adds the specified to the collection.
A to add.
is .
Adds the specified to the collection.
A that contains the cookies to add.
is .
Copies the elements of the collection to the specified , starting at
the specified in the .
An that represents the destination of the elements copied from
the collection.
An that represents the zero-based index in
at which copying begins.
is .
is less than zero.
is multidimensional.
-or-
The number of elements in the collection is greater than the available space from
to the end of the destination .
The elements in the collection cannot be cast automatically to the type of the destination
.
Copies the elements of the collection to the specified array of ,
starting at the specified in the .
An array of that represents the destination of the elements
copied from the collection.
An that represents the zero-based index in
at which copying begins.
is .
is less than zero.
The number of elements in the collection is greater than the available space from
to the end of the destination .
Gets the enumerator used to iterate through the collection.
An instance used to iterate through the collection.
The exception that is thrown when a gets an error.
Initializes a new instance of the class from
the specified and .
A that contains the serialized object data.
A that specifies the source for the deserialization.
Initializes a new instance of the class.
Populates the specified with the data needed to serialize
the current .
A that holds the serialized object data.
A that specifies the destination for the serialization.
Populates the specified with the data needed to serialize
the current .
A that holds the serialized object data.
A that specifies the destination for the serialization.
Holds the username and password from an HTTP Basic authentication attempt.
Gets the password from a basic authentication attempt.
A that represents the password.
Holds the username and other parameters from
an HTTP Digest authentication attempt.
Gets the algorithm parameter from a digest authentication attempt.
A that represents the algorithm parameter.
Gets the cnonce parameter from a digest authentication attempt.
A that represents the cnonce parameter.
Gets the nc parameter from a digest authentication attempt.
A that represents the nc parameter.
Gets the nonce parameter from a digest authentication attempt.
A that represents the nonce parameter.
Gets the opaque parameter from a digest authentication attempt.
A that represents the opaque parameter.
Gets the qop parameter from a digest authentication attempt.
A that represents the qop parameter.
Gets the realm parameter from a digest authentication attempt.
A that represents the realm parameter.
Gets the response parameter from a digest authentication attempt.
A that represents the response parameter.
Gets the uri parameter from a digest authentication attempt.
A that represents the uri parameter.
Provides a simple, programmatically controlled HTTP listener.
Initializes a new instance of the class.
Gets or sets the scheme used to authenticate the clients.
One of the enum values,
represents the scheme used to authenticate the clients. The default value is
.
This listener has been closed.
Gets or sets the delegate called to select the scheme used to authenticate the clients.
If you set this property, the listener uses the authentication scheme selected by
the delegate for each request. Or if you don't set, the listener uses the value of
the property as the authentication
scheme for all requests.
A Func<, >
delegate that references the method used to select an authentication scheme. The default
value is .
This listener has been closed.
Gets or sets the path to the folder in which stores the certificate files used to
authenticate the server on the secure connection.
This property represents the path to the folder in which stores the certificate files
associated with each port number of added URI prefixes. A set of the certificate files
is a pair of the 'port number'.cer (DER) and 'port number'.key
(DER, RSA Private Key).
If this property is or empty, the result of
System.Environment.GetFolderPath
() is used as the default path.
A that represents the path to the folder in which stores
the certificate files. The default value is .
This listener has been closed.
Gets or sets a value indicating whether the listener returns exceptions that occur when
sending the response to the client.
true if the listener shouldn't return those exceptions; otherwise, false.
The default value is false.
This listener has been closed.
Gets a value indicating whether the listener has been started.
true if the listener has been started; otherwise, false.
Gets a value indicating whether the listener can be used with the current operating system.
true.
Gets the logging functions.
The default logging level is . If you would like to change it,
you should set the Log.Level property to any of the enum
values.
A that provides the logging functions.
Gets the URI prefixes handled by the listener.
A that contains the URI prefixes.
This listener has been closed.
Gets or sets the name of the realm associated with the listener.
If this property is or empty, "SECRET AREA" will be used as
the name of the realm.
A that represents the name of the realm. The default value is
.
This listener has been closed.
Gets or sets the SSL configuration used to authenticate the server and
optionally the client for secure connection.
A that represents the configuration used to
authenticate the server and optionally the client for secure connection.
This listener has been closed.
Gets or sets a value indicating whether, when NTLM authentication is used,
the authentication information of first request is used to authenticate
additional requests on the same connection.
This property isn't currently supported and always throws
a .
true if the authentication information of first request is used;
otherwise, false.
Any use of this property.
Gets or sets the delegate called to find the credentials for an identity used to
authenticate a client.
A Func<, > delegate
that references the method used to find the credentials. The default value is
.
This listener has been closed.
Shuts down the listener immediately.
Begins getting an incoming request asynchronously.
This asynchronous operation must be completed by calling the EndGetContext method.
Typically, the method is invoked by the delegate.
An that represents the status of the asynchronous operation.
An delegate that references the method to invoke when
the asynchronous operation completes.
An that represents a user defined object to pass to
the delegate.
This listener has no URI prefix on which listens.
-or-
This listener hasn't been started, or is currently stopped.
This listener has been closed.
Shuts down the listener.
Ends an asynchronous operation to get an incoming request.
This method completes an asynchronous operation started by calling
the BeginGetContext method.
A that represents a request.
An obtained by calling the BeginGetContext method.
is .
wasn't obtained by calling the BeginGetContext method.
This method was already called for the specified .
This listener has been closed.
Gets an incoming request.
This method waits for an incoming request, and returns when a request is received.
A that represents a request.
This listener has no URI prefix on which listens.
-or-
This listener hasn't been started, or is currently stopped.
This listener has been closed.
Starts receiving incoming requests.
This listener has been closed.
Stops receiving incoming requests.
This listener has been closed.
Releases all resources used by the listener.
Provides the access to the HTTP request and response objects used by
the .
This class cannot be inherited.
Gets the HTTP request object that represents a client request.
A that represents the client request.
Gets the HTTP response object used to send a response to the client.
A that represents a response to the client request.
Gets the client information (identity, authentication, and security roles).
A instance that represents the client information.
Accepts a WebSocket handshake request.
A that represents
the WebSocket handshake request.
A that represents the subprotocol supported on
this WebSocket connection.
is empty.
-or-
contains an invalid character.
This method has already been called.
The exception that is thrown when a gets an error
processing an HTTP request.
Initializes a new instance of the class from
the specified and .
A that contains the serialized object data.
A that specifies the source for the deserialization.
Initializes a new instance of the class.
Initializes a new instance of the class
with the specified .
An that identifies the error.
Initializes a new instance of the class
with the specified and .
An that identifies the error.
A that describes the error.
Gets the error code that identifies the error that occurred.
An that identifies the error.
Initializes a new instance of the class with
the specified .
This constructor must be called after calling the CheckPrefix method.
A that represents the URI prefix.
Determines whether this instance and the specified have the same value.
This method will be required to detect duplicates in any collection.
An to compare to this instance.
true if is a and
its value is the same as this instance; otherwise, false.
Gets the hash code for this instance.
This method will be required to detect duplicates in any collection.
An that represents the hash code.
Provides the collection used to store the URI prefixes for the .
The responds to the request which has a requested URI that
the prefixes most closely match.
Gets the number of prefixes in the collection.
An that represents the number of prefixes.
Gets a value indicating whether the access to the collection is read-only.
Always returns false.
Gets a value indicating whether the access to the collection is synchronized.
Always returns false.
Adds the specified to the collection.
A that represents the URI prefix to add. The prefix must be
a well-formed URI prefix with http or https scheme, and must end with a '/'.
is .
is invalid.
The associated with this collection is closed.
Removes all URI prefixes from the collection.
The associated with this collection is closed.
Returns a value indicating whether the collection contains the specified
.
true if the collection contains ;
otherwise, false.
A that represents the URI prefix to test.
is .
The associated with this collection is closed.
Copies the contents of the collection to the specified .
An that receives the URI prefix strings in the collection.
An that represents the zero-based index in
at which copying begins.
The associated with this collection is closed.
Copies the contents of the collection to the specified array of .
An array of that receives the URI prefix strings in the collection.
An that represents the zero-based index in
at which copying begins.
The associated with this collection is closed.
Gets the enumerator used to iterate through the .
An instance used to iterate
through the collection.
Removes the specified from the collection.
true if is successfully found and removed;
otherwise, false.
A that represents the URI prefix to remove.
is .
The associated with this collection is closed.
Gets the enumerator used to iterate through the .
An instance used to iterate through the collection.
Provides the access to a request to the .
The HttpListenerRequest class cannot be inherited.
Gets the media types which are acceptable for the response.
An array of that contains the media type names in
the Accept request-header, or if the request didn't include
the Accept header.
Gets an error code that identifies a problem with the client's certificate.
Always returns 0.
Gets the encoding for the entity body data included in the request.
A that represents the encoding for the entity body data,
or if the request didn't include the information about
the encoding.
Gets the number of bytes in the entity body data included in the request.
A that represents the value of the Content-Length entity-header,
or -1 if the value isn't known.
Gets the media type of the entity body included in the request.
A that represents the value of the Content-Type entity-header.
Gets the cookies included in the request.
A that contains the cookies included in the request.
Gets a value indicating whether the request has the entity body.
true if the request has the entity body; otherwise, false.
Gets the HTTP headers used in the request.
A that contains the HTTP headers used in the request.
Gets the HTTP method used in the request.
A that represents the HTTP method used in the request.
Gets a that contains the entity body data included in the request.
A that contains the entity body data included in the request.
Gets a value indicating whether the client that sent the request is authenticated.
true if the client is authenticated; otherwise, false.
Gets a value indicating whether the request is sent from the local computer.
true if the request is sent from the local computer; otherwise, false.
Gets a value indicating whether the HTTP connection is secured using the SSL protocol.
true if the HTTP connection is secured; otherwise, false.
Gets a value indicating whether the request is a WebSocket connection request.
true if the request is a WebSocket connection request; otherwise, false.
Gets a value indicating whether the client requests a persistent connection.
true if the client requests a persistent connection; otherwise, false.
Gets the server endpoint as an IP address and a port number.
A that represents the server endpoint.
Gets the HTTP version used in the request.
A that represents the HTTP version used in the request.
Gets the query string included in the request.
A that contains the query string parameters.
Gets the raw URL (without the scheme, host, and port) requested by the client.
A that represents the raw URL requested by the client.
Gets the client endpoint as an IP address and a port number.
A that represents the client endpoint.
Gets the request identifier of a incoming HTTP request.
A that represents the identifier of a request.
Gets the URL requested by the client.
A that represents the URL requested by the client.
Gets the URL of the resource from which the requested URL was obtained.
A that represents the value of the Referer request-header,
or if the request didn't include an Referer header.
Gets the information about the user agent originating the request.
A that represents the value of the User-Agent request-header.
Gets the server endpoint as an IP address and a port number.
A that represents the server endpoint.
Gets the internet host name and port number (if present) specified by the client.
A that represents the value of the Host request-header.
Gets the natural languages which are preferred for the response.
An array of that contains the natural language names in
the Accept-Language request-header, or if the request
didn't include an Accept-Language header.
Begins getting the client's X.509 v.3 certificate asynchronously.
This asynchronous operation must be completed by calling
the method. Typically,
that method is invoked by the delegate.
An that contains the status of the asynchronous operation.
An delegate that references the method(s) called when
the asynchronous operation completes.
An that contains a user defined object to pass to
the delegate.
This method isn't implemented.
Ends an asynchronous operation to get the client's X.509 v.3 certificate.
This method completes an asynchronous operation started by calling
the method.
A that contains the client's X.509 v.3 certificate.
An obtained by calling
the method.
This method isn't implemented.
Gets the client's X.509 v.3 certificate.
A that contains the client's X.509 v.3 certificate.
This method isn't implemented.
Returns a that represents
the current .
A that represents the current .
Provides the access to a response to a request received by the .
The HttpListenerResponse class cannot be inherited.
Gets or sets the encoding for the entity body data included in the response.
A that represents the encoding for the entity body data,
or if no encoding is specified.
This object is closed.
Gets or sets the number of bytes in the entity body data included in the response.
A that represents the value of the Content-Length entity-header.
The value specified for a set operation is less than zero.
The response has already been sent.
This object is closed.
Gets or sets the media type of the entity body included in the response.
A that represents the media type of the entity body,
or if no media type is specified. This value is
used for the value of the Content-Type entity-header.
The value specified for a set operation is empty.
This object is closed.
Gets or sets the cookies sent with the response.
A that contains the cookies sent with the response.
Gets or sets the HTTP headers sent to the client.
A that contains the headers sent to the client.
The value specified for a set operation isn't valid for a response.
Gets or sets a value indicating whether the server requests a persistent connection.
true if the server requests a persistent connection; otherwise, false.
The default value is true.
The response has already been sent.
This object is closed.
Gets a to use to write the entity body data.
A to use to write the entity body data.
This object is closed.
Gets or sets the HTTP version used in the response.
A that represents the version used in the response.
The value specified for a set operation is .
The value specified for a set operation doesn't have its Major property set to 1 or
doesn't have its Minor property set to either 0 or 1.
The response has already been sent.
This object is closed.
Gets or sets the URL to which the client is redirected to locate a requested resource.
A that represents the value of the Location response-header,
or if no redirect location is specified.
The value specified for a set operation isn't an absolute URL.
This object is closed.
Gets or sets a value indicating whether the response uses the chunked transfer encoding.
true if the response uses the chunked transfer encoding;
otherwise, false. The default value is false.
The response has already been sent.
This object is closed.
Gets or sets the HTTP status code returned to the client.
An that represents the status code for the response to
the request. The default value is same as .
The response has already been sent.
This object is closed.
The value specified for a set operation is invalid. Valid values are
between 100 and 999 inclusive.
Gets or sets the description of the HTTP status code returned to the client.
A that represents the description of the status code. The default
value is the RFC 2616
description for the property value,
or if an RFC 2616 description doesn't exist.
The value specified for a set operation contains invalid characters.
The response has already been sent.
This object is closed.
Closes the connection to the client without returning a response.
Adds an HTTP header with the specified and
to the headers for the response.
A that represents the name of the header to add.
A that represents the value of the header to add.
is or empty.
or contains invalid characters.
-or-
is a restricted header name.
The length of is greater than 65,535 characters.
The header cannot be allowed to add to the current headers.
Appends the specified to the cookies sent with the response.
A to append.
is .
Appends a to the specified HTTP header sent with the response.
A that represents the name of the header to append
to.
A that represents the value to append to the header.
is or empty.
or contains invalid characters.
-or-
is a restricted header name.
The length of is greater than 65,535 characters.
The current headers cannot allow the header to append a value.
Returns the response to the client and releases the resources used by
this instance.
Returns the response with the specified array of to the client and
releases the resources used by this instance.
An array of that contains the response entity body data.
true if this method blocks execution while flushing the stream to the client;
otherwise, false.
is .
This object is closed.
Copies some properties from the specified to
this response.
A to copy.
is .
Configures the response to redirect the client's request to
the specified .
This method sets the property to
, the property to
302, and the property to
"Found".
A that represents the URL to redirect the client's request to.
is .
isn't an absolute URL.
The response has already been sent.
This object is closed.
Adds or updates a in the cookies sent with the response.
A to set.
is .
already exists in the cookies and couldn't be replaced.
Releases all resources used by the .
Contains the HTTP headers that may be specified in a client request.
The HttpRequestHeader enumeration contains the HTTP request headers defined in
RFC 2616 for the HTTP/1.1 and
RFC 6455 for the WebSocket.
Indicates the Cache-Control header.
Indicates the Connection header.
Indicates the Date header.
Indicates the Keep-Alive header.
Indicates the Pragma header.
Indicates the Trailer header.
Indicates the Transfer-Encoding header.
Indicates the Upgrade header.
Indicates the Via header.
Indicates the Warning header.
Indicates the Allow header.
Indicates the Content-Length header.
Indicates the Content-Type header.
Indicates the Content-Encoding header.
Indicates the Content-Language header.
Indicates the Content-Location header.
Indicates the Content-MD5 header.
Indicates the Content-Range header.
Indicates the Expires header.
Indicates the Last-Modified header.
Indicates the Accept header.
Indicates the Accept-Charset header.
Indicates the Accept-Encoding header.
Indicates the Accept-Language header.
Indicates the Authorization header.
Indicates the Cookie header.
Indicates the Expect header.
Indicates the From header.
Indicates the Host header.
Indicates the If-Match header.
Indicates the If-Modified-Since header.
Indicates the If-None-Match header.
Indicates the If-Range header.
Indicates the If-Unmodified-Since header.
Indicates the Max-Forwards header.
Indicates the Proxy-Authorization header.
Indicates the Referer header.
Indicates the Range header.
Indicates the TE header.
Indicates the Translate header.
Indicates the User-Agent header.
Indicates the Sec-WebSocket-Key header.
Indicates the Sec-WebSocket-Extensions header.
Indicates the Sec-WebSocket-Protocol header.
Indicates the Sec-WebSocket-Version header.
Contains the HTTP headers that can be specified in a server response.
The HttpResponseHeader enumeration contains the HTTP response headers defined in
RFC 2616 for the HTTP/1.1 and
RFC 6455 for the WebSocket.
Indicates the Cache-Control header.
Indicates the Connection header.
Indicates the Date header.
Indicates the Keep-Alive header.
Indicates the Pragma header.
Indicates the Trailer header.
Indicates the Transfer-Encoding header.
Indicates the Upgrade header.
Indicates the Via header.
Indicates the Warning header.
Indicates the Allow header.
Indicates the Content-Length header.
Indicates the Content-Type header.
Indicates the Content-Encoding header.
Indicates the Content-Language header.
Indicates the Content-Location header.
Indicates the Content-MD5 header.
Indicates the Content-Range header.
Indicates the Expires header.
Indicates the Last-Modified header.
Indicates the Accept-Ranges header.
Indicates the Age header.
Indicates the ETag header.
Indicates the Location header.
Indicates the Proxy-Authenticate header.
Indicates the Retry-After header.
Indicates the Server header.
Indicates the Set-Cookie header.
Indicates the Vary header.
Indicates the WWW-Authenticate header.
Indicates the Sec-WebSocket-Extensions header.
Indicates the Sec-WebSocket-Accept header.
Indicates the Sec-WebSocket-Protocol header.
Indicates the Sec-WebSocket-Version header.
Contains the values of the HTTP status codes.
The HttpStatusCode enumeration contains the values of the HTTP status codes defined in
RFC 2616 for the HTTP/1.1.
Equivalent to status code 100.
Indicates that the client should continue with its request.
Equivalent to status code 101.
Indicates that the server is switching the HTTP version or protocol on the connection.
Equivalent to status code 200.
Indicates that the client's request has succeeded.
Equivalent to status code 201.
Indicates that the client's request has been fulfilled and resulted in a new resource being
created.
Equivalent to status code 202.
Indicates that the client's request has been accepted for processing, but the processing
hasn't been completed.
Equivalent to status code 203.
Indicates that the returned metainformation is from a local or a third-party copy instead of
the origin server.
Equivalent to status code 204.
Indicates that the server has fulfilled the client's request but doesn't need to return
an entity-body.
Equivalent to status code 205.
Indicates that the server has fulfilled the client's request, and the user agent should
reset the document view which caused the request to be sent.
Equivalent to status code 206.
Indicates that the server has fulfilled the partial GET request for the resource.
Equivalent to status code 300.
Indicates that the requested resource corresponds to any of multiple representations.
MultipleChoices is a synonym for Ambiguous.
Equivalent to status code 300.
Indicates that the requested resource corresponds to any of multiple representations.
Ambiguous is a synonym for MultipleChoices.
Equivalent to status code 301.
Indicates that the requested resource has been assigned a new permanent URI and
any future references to this resource should use one of the returned URIs.
MovedPermanently is a synonym for Moved.
Equivalent to status code 301.
Indicates that the requested resource has been assigned a new permanent URI and
any future references to this resource should use one of the returned URIs.
Moved is a synonym for MovedPermanently.
Equivalent to status code 302.
Indicates that the requested resource is located temporarily under a different URI.
Found is a synonym for Redirect.
Equivalent to status code 302.
Indicates that the requested resource is located temporarily under a different URI.
Redirect is a synonym for Found.
Equivalent to status code 303.
Indicates that the response to the request can be found under a different URI and
should be retrieved using a GET method on that resource.
SeeOther is a synonym for RedirectMethod.
Equivalent to status code 303.
Indicates that the response to the request can be found under a different URI and
should be retrieved using a GET method on that resource.
RedirectMethod is a synonym for SeeOther.
Equivalent to status code 304.
Indicates that the client has performed a conditional GET request and access is allowed,
but the document hasn't been modified.
Equivalent to status code 305.
Indicates that the requested resource must be accessed through the proxy given by
the Location field.
Equivalent to status code 306.
This status code was used in a previous version of the specification, is no longer used,
and is reserved for future use.
Equivalent to status code 307.
Indicates that the requested resource is located temporarily under a different URI.
TemporaryRedirect is a synonym for RedirectKeepVerb.
Equivalent to status code 307.
Indicates that the requested resource is located temporarily under a different URI.
RedirectKeepVerb is a synonym for TemporaryRedirect.
Equivalent to status code 400.
Indicates that the client's request couldn't be understood by the server due to
malformed syntax.
Equivalent to status code 401.
Indicates that the client's request requires user authentication.
Equivalent to status code 402.
This status code is reserved for future use.
Equivalent to status code 403.
Indicates that the server understood the client's request but is refusing to fulfill it.
Equivalent to status code 404.
Indicates that the server hasn't found anything matching the request URI.
Equivalent to status code 405.
Indicates that the method specified in the request line isn't allowed for the resource
identified by the request URI.
Equivalent to status code 406.
Indicates that the server doesn't have the appropriate resource to respond to the Accept
headers in the client's request.
Equivalent to status code 407.
Indicates that the client must first authenticate itself with the proxy.
Equivalent to status code 408.
Indicates that the client didn't produce a request within the time that the server was
prepared to wait.
Equivalent to status code 409.
Indicates that the client's request couldn't be completed due to a conflict on the server.
Equivalent to status code 410.
Indicates that the requested resource is no longer available at the server and
no forwarding address is known.
Equivalent to status code 411.
Indicates that the server refuses to accept the client's request without a defined
Content-Length.
Equivalent to status code 412.
Indicates that the precondition given in one or more of the request headers evaluated to
false when it was tested on the server.
Equivalent to status code 413.
Indicates that the entity of the client's request is larger than the server is willing or
able to process.
Equivalent to status code 414.
Indicates that the request URI is longer than the server is willing to interpret.
Equivalent to status code 415.
Indicates that the entity of the client's request is in a format not supported by
the requested resource for the requested method.
Equivalent to status code 416.
Indicates that none of the range specifier values in a Range request header overlap
the current extent of the selected resource.
Equivalent to status code 417.
Indicates that the expectation given in an Expect request header couldn't be met by
the server.
Equivalent to status code 500.
Indicates that the server encountered an unexpected condition which prevented it from
fulfilling the client's request.
Equivalent to status code 501.
Indicates that the server doesn't support the functionality required to fulfill the client's
request.
Equivalent to status code 502.
Indicates that a gateway or proxy server received an invalid response from the upstream
server.
Equivalent to status code 503.
Indicates that the server is currently unable to handle the client's request due to
a temporary overloading or maintenance of the server.
Equivalent to status code 504.
Indicates that a gateway or proxy server didn't receive a timely response from the upstream
server or some other auxiliary server.
Equivalent to status code 505.
Indicates that the server doesn't support the HTTP version used in the client's request.
Decodes an HTML-encoded and returns the decoded .
A that represents the decoded string.
A to decode.
Decodes an HTML-encoded and sends the decoded
to the specified .
A to decode.
A that receives the decoded string.
HTML-encodes a and returns the encoded .
A that represents the encoded string.
A to encode.
HTML-encodes a and sends the encoded
to the specified .
A to encode.
A that receives the encoded string.
Provides the HTTP version numbers.
Provides a instance for the HTTP/1.0.
Provides a instance for the HTTP/1.1.
Initializes a new instance of the class.
Provides the credentials for the password-based authentication.
Initializes a new instance of the class with
the specified and .
A that represents the username associated with
the credentials.
A that represents the password for the username
associated with the credentials.
is .
is empty.
Initializes a new instance of the class with
the specified , ,
and .
A that represents the username associated with
the credentials.
A that represents the password for the username
associated with the credentials.
A that represents the domain associated with
the credentials.
An array of that represents the roles
associated with the credentials if any.
is .
is empty.
Gets the domain associated with the credentials.
This property returns an empty string if the domain was
initialized with .
A that represents the domain name
to which the username belongs.
Gets the password for the username associated with the credentials.
This property returns an empty string if the password was
initialized with .
A that represents the password.
Gets the roles associated with the credentials.
This property returns an empty array if the roles were
initialized with .
An array of that represents the role names
to which the username belongs.
Gets the username associated with the credentials.
A that represents the username.
Stores the parameters for the used by servers.
Initializes a new instance of the class.
Initializes a new instance of the class
with the specified .
A that represents the certificate used to
authenticate the server.
Copies the parameters from the specified to
a new instance of the class.
A from which to copy.
is .
Gets or sets a value indicating whether the certificate revocation
list is checked during authentication.
true if the certificate revocation list is checked during
authentication; otherwise, false.
The default value is false.
Gets or sets a value indicating whether the client is asked for
a certificate for authentication.
true if the client is asked for a certificate for
authentication; otherwise, false.
The default value is false.
Gets or sets the callback used to validate the certificate
supplied by the client.
The certificate is valid if the callback returns true.
A delegate that
invokes the method called for validating the certificate.
The default value is a delegate that invokes a method that
only returns true.
Gets or sets the protocols used for authentication.
The enum values that represent
the protocols used for authentication.
The default value is .
Gets or sets the certificate used to authenticate the server.
A or
if not specified.
That instance represents an X.509 certificate.
Provides a collection of the HTTP headers associated with a request or response.
Initializes a new instance of the class from
the specified and .
A that contains the serialized object data.
A that specifies the source for the deserialization.
is .
An element with the specified name isn't found in .
Initializes a new instance of the class.
Gets all header names in the collection.
An array of that contains all header names in the collection.
Gets the number of headers in the collection.
An that represents the number of headers in the collection.
Gets or sets the specified request in the collection.
A that represents the value of the request .
One of the enum values, represents
the request header to get or set.
is a restricted header.
-or-
contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the request .
Gets or sets the specified response in the collection.
A that represents the value of the response .
One of the enum values, represents
the response header to get or set.
is a restricted header.
-or-
contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the response .
Gets a collection of header names in the collection.
A that contains
all header names in the collection.
Adds a header to the collection without checking if the header is on
the restricted header list.
A that represents the name of the header to add.
A that represents the value of the header to add.
is or empty.
or contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the .
Adds the specified to the collection.
A that represents the header with the name and value separated by
a colon (':').
is , empty, or the name part of
is empty.
doesn't contain a colon.
-or-
is a restricted header.
-or-
The name or value part of contains invalid characters.
The length of the value part of is greater than 65,535 characters.
The current instance doesn't allow
the .
Adds the specified request with
the specified to the collection.
One of the enum values, represents
the request header to add.
A that represents the value of the header to add.
is a restricted header.
-or-
contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the request .
Adds the specified response with
the specified to the collection.
One of the enum values, represents
the response header to add.
A that represents the value of the header to add.
is a restricted header.
-or-
contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the response .
Adds a header with the specified and
to the collection.
A that represents the name of the header to add.
A that represents the value of the header to add.
is or empty.
or contains invalid characters.
-or-
is a restricted header name.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the header .
Removes all headers from the collection.
Get the value of the header at the specified in the collection.
A that receives the value of the header.
An that represents the zero-based index of the header to find.
is out of allowable range of indexes for the collection.
Get the value of the header with the specified in the collection.
A that receives the value of the header if found;
otherwise, .
A that represents the name of the header to find.
Gets the enumerator used to iterate through the collection.
An instance used to iterate through the collection.
Get the name of the header at the specified in the collection.
A that receives the header name.
An that represents the zero-based index of the header to find.
is out of allowable range of indexes for the collection.
Gets an array of header values stored in the specified position of
the collection.
An array of that receives the header values if found;
otherwise, .
An that represents the zero-based index of the header to find.
is out of allowable range of indexes for the collection.
Gets an array of header values stored in the specified .
An array of that receives the header values if found;
otherwise, .
A that represents the name of the header to find.
Populates the specified with the data needed to serialize
the .
A that holds the serialized object data.
A that specifies the destination for the serialization.
is .
Determines whether the specified header can be set for the request.
true if the header is restricted; otherwise, false.
A that represents the name of the header to test.
is or empty.
contains invalid characters.
Determines whether the specified header can be set for the request or the response.
true if the header is restricted; otherwise, false.
A that represents the name of the header to test.
true if does the test for the response; for the request, false.
is or empty.
contains invalid characters.
Implements the interface and raises the deserialization event
when the deserialization is complete.
An that represents the source of the deserialization event.
Removes the specified request from the collection.
One of the enum values, represents
the request header to remove.
is a restricted header.
The current instance doesn't allow
the request .
Removes the specified response from the collection.
One of the enum values, represents
the response header to remove.
is a restricted header.
The current instance doesn't allow
the response .
Removes the specified header from the collection.
A that represents the name of the header to remove.
is or empty.
contains invalid characters.
-or-
is a restricted header name.
The current instance doesn't allow
the header .
Sets the specified request to the specified value.
One of the enum values, represents
the request header to set.
A that represents the value of the request header to set.
is a restricted header.
-or-
contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the request .
Sets the specified response to the specified value.
One of the enum values, represents
the response header to set.
A that represents the value of the response header to set.
is a restricted header.
-or-
contains invalid characters.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the response .
Sets the specified header to the specified value.
A that represents the name of the header to set.
A that represents the value of the header to set.
is or empty.
or contains invalid characters.
-or-
is a restricted header name.
The length of is greater than 65,535 characters.
The current instance doesn't allow
the header .
Converts the current to an array of .
An array of that receives the converted current
.
Returns a that represents the current
.
A that represents the current .
Populates the specified with the data needed to serialize
the current .
A that holds the serialized object data.
A that specifies the destination for the serialization.
is .
Provides the properties used to access the information in
a WebSocket handshake request received by the .
Gets the HTTP cookies included in the request.
A that contains the cookies.
Gets the HTTP headers included in the request.
A that contains the headers.
Gets the value of the Host header included in the request.
A that represents the value of the Host header.
Gets a value indicating whether the client is authenticated.
true if the client is authenticated; otherwise, false.
Gets a value indicating whether the client connected from the local computer.
true if the client connected from the local computer; otherwise, false.
Gets a value indicating whether the WebSocket connection is secured.
true if the connection is secured; otherwise, false.
Gets a value indicating whether the request is a WebSocket handshake request.
true if the request is a WebSocket handshake request; otherwise, false.
Gets the value of the Origin header included in the request.
A that represents the value of the Origin header.
Gets the query string included in the request.
A that contains the query string parameters.
Gets the URI requested by the client.
A that represents the requested URI.
Gets the value of the Sec-WebSocket-Key header included in the request.
This property provides a part of the information used by the server to prove that
it received a valid WebSocket handshake request.
A that represents the value of the Sec-WebSocket-Key header.
Gets the values of the Sec-WebSocket-Protocol header included in the request.
This property represents the subprotocols requested by the client.
An instance that provides
an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol
header.
Gets the value of the Sec-WebSocket-Version header included in the request.
This property represents the WebSocket protocol version.
A that represents the value of the Sec-WebSocket-Version header.
Gets the server endpoint as an IP address and a port number.
A that represents the server endpoint.
Gets the client information (identity, authentication, and security roles).
A instance that represents the client information.
Gets the client endpoint as an IP address and a port number.
A that represents the client endpoint.
Gets the instance used for
two-way communication between client and server.
A .
Returns a that represents
the current .
A that represents
the current .
Provides the properties used to access the information in
a WebSocket handshake request received by the .
Gets the HTTP cookies included in the request.
A that contains the cookies.
Gets the HTTP headers included in the request.
A that contains the headers.
Gets the value of the Host header included in the request.
A that represents the value of the Host header.
Gets a value indicating whether the client is authenticated.
true if the client is authenticated; otherwise, false.
Gets a value indicating whether the client connected from the local computer.
true if the client connected from the local computer; otherwise, false.
Gets a value indicating whether the WebSocket connection is secured.
true if the connection is secured; otherwise, false.
Gets a value indicating whether the request is a WebSocket handshake request.
true if the request is a WebSocket handshake request; otherwise, false.
Gets the value of the Origin header included in the request.
A that represents the value of the Origin header.
Gets the query string included in the request.
A that contains the query string parameters.
Gets the URI requested by the client.
A that represents the requested URI.
Gets the value of the Sec-WebSocket-Key header included in the request.
This property provides a part of the information used by the server to prove that
it received a valid WebSocket handshake request.
A that represents the value of the Sec-WebSocket-Key header.
Gets the values of the Sec-WebSocket-Protocol header included in the request.
This property represents the subprotocols requested by the client.
An instance that provides
an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol
header.
Gets the value of the Sec-WebSocket-Version header included in the request.
This property represents the WebSocket protocol version.
A that represents the value of the Sec-WebSocket-Version header.
Gets the server endpoint as an IP address and a port number.
A that represents the server endpoint.
Gets the client information (identity, authentication, and security roles).
A instance that represents the client information.
Gets the client endpoint as an IP address and a port number.
A that represents the client endpoint.
Gets the instance used for
two-way communication between client and server.
A .
Returns a that represents
the current .
A that represents
the current .
Exposes the properties used to access the information in a WebSocket handshake request.
This class is an abstract class.
Initializes a new instance of the class.
Gets the HTTP cookies included in the request.
A that contains the cookies.
Gets the HTTP headers included in the request.
A that contains the headers.
Gets the value of the Host header included in the request.
A that represents the value of the Host header.
Gets a value indicating whether the client is authenticated.
true if the client is authenticated; otherwise, false.
Gets a value indicating whether the client connected from the local computer.
true if the client connected from the local computer; otherwise, false.
Gets a value indicating whether the WebSocket connection is secured.
true if the connection is secured; otherwise, false.
Gets a value indicating whether the request is a WebSocket handshake request.
true if the request is a WebSocket handshake request; otherwise, false.
Gets the value of the Origin header included in the request.
A that represents the value of the Origin header.
Gets the query string included in the request.
A that contains the query string parameters.
Gets the URI requested by the client.
A that represents the requested URI.
Gets the value of the Sec-WebSocket-Key header included in the request.
This property provides a part of the information used by the server to prove that
it received a valid WebSocket handshake request.
A that represents the value of the Sec-WebSocket-Key header.
Gets the values of the Sec-WebSocket-Protocol header included in the request.
This property represents the subprotocols requested by the client.
An instance that provides
an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol
header.
Gets the value of the Sec-WebSocket-Version header included in the request.
This property represents the WebSocket protocol version.
A that represents the value of the Sec-WebSocket-Version header.
Gets the server endpoint as an IP address and a port number.
A that represents the server endpoint.
Gets the client information (identity, authentication, and security roles).
A instance that represents the client information.
Gets the client endpoint as an IP address and a port number.
A that represents the client endpoint.
Gets the instance used for
two-way communication between client and server.
A .
Indicates the WebSocket frame type.
The values of this enumeration are defined in
Section 5.2 of RFC 6455.
Equivalent to numeric value 0. Indicates continuation frame.
Equivalent to numeric value 1. Indicates text frame.
Equivalent to numeric value 2. Indicates binary frame.
Equivalent to numeric value 8. Indicates connection close frame.
Equivalent to numeric value 9. Indicates ping frame.
Equivalent to numeric value 10. Indicates pong frame.
Represents the empty payload data.
Represents the allowable max length.
A will occur if the payload data length is
greater than the value of this field.
If you would like to change the value, you must set it to a value between
WebSocket.FragmentLength and Int64.MaxValue inclusive.
Indicates whether each RSV (RSV1, RSV2, and RSV3) of a WebSocket frame is non-zero.
The values of this enumeration are defined in
Section 5.2 of RFC 6455.
Equivalent to numeric value 0. Indicates zero.
Equivalent to numeric value 1. Indicates non-zero.
Represents the event data for the HTTP request events of
the .
An HTTP request event occurs when the
receives an HTTP request.
You should access the property if you would
like to get the request data sent from a client.
And you should access the property if you would
like to get the response data to return to the client.
Gets the request data sent from a client.
A that provides the methods and
properties for the request data.
Gets the response data to return to the client.
A that provides the methods and
properties for the response data.
Gets the information for the client.
A instance or
if not authenticated.
That instance describes the identity, authentication scheme,
and security roles for the client.
Reads the specified file from the document folder of
the .
An array of or
if it fails.
That array receives the contents of the file.
A that represents a virtual path to
find the file from the document folder.
is .
is an empty string.
-or-
contains "..".
Tries to read the specified file from the document folder of
the .
true if it succeeds to read; otherwise, false.
A that represents a virtual path to
find the file from the document folder.
When this method returns, an array of or
if it fails.
That array receives the contents of the file.
is .
is an empty string.
-or-
contains "..".
Provides a simple HTTP server that allows to accept
WebSocket handshake requests.
This class can provide multiple WebSocket services.
Initializes a new instance of the class.
The new instance listens for incoming requests on
and port 80.
Initializes a new instance of the class with
the specified .
The new instance listens for incoming requests on
and .
It provides secure connections if is 443.
An that represents the number of the port
on which to listen.
is less than 1 or greater than 65535.
Initializes a new instance of the class with
the specified .
The new instance listens for incoming requests on the IP address of the
host of and the port of .
Either port 80 or 443 is used if includes
no port. Port 443 is used if the scheme of
is https; otherwise, port 80 is used.
The new instance provides secure connections if the scheme of
is https.
A that represents the HTTP URL of the server.
is .
is empty.
-or-
is invalid.
Initializes a new instance of the class with
the specified and .
The new instance listens for incoming requests on
and .
An that represents the number of the port
on which to listen.
A : true if the new instance provides
secure connections; otherwise, false.
is less than 1 or greater than 65535.
Initializes a new instance of the class with
the specified and .
The new instance listens for incoming requests on
and .
It provides secure connections if is 443.
A that represents
the local IP address on which to listen.
An that represents the number of the port
on which to listen.
is .
is not a local IP address.
is less than 1 or greater than 65535.
Initializes a new instance of the class with
the specified , ,
and .
The new instance listens for incoming requests on
and .
A that represents
the local IP address on which to listen.
An that represents the number of the port
on which to listen.
A : true if the new instance provides
secure connections; otherwise, false.
is .
is not a local IP address.
is less than 1 or greater than 65535.
Gets the IP address of the server.
A that represents the local
IP address on which to listen for incoming requests.
Gets or sets the scheme used to authenticate the clients.
The set operation does nothing if the server has already
started or it is shutting down.
One of the
enum values.
It represents the scheme used to authenticate the clients.
The default value is
.
Gets or sets the path to the document folder of the server.
'/' or '\' is trimmed from the end of the value if any.
The set operation does nothing if the server has already
started or it is shutting down.
A that represents a path to the folder
from which to find the requested file.
The default value is "./Public".
The value specified for a set operation is .
The value specified for a set operation is an empty string.
-or-
The value specified for a set operation is an invalid path string.
-or-
The value specified for a set operation is an absolute root.
Gets a value indicating whether the server has started.
true if the server has started; otherwise, false.
Gets a value indicating whether the server provides
secure connections.
true if the server provides secure connections;
otherwise, false.
Gets or sets a value indicating whether the server cleans up
the inactive sessions periodically.
The set operation does nothing if the server has already
started or it is shutting down.
true if the server cleans up the inactive sessions
every 60 seconds; otherwise, false.
The default value is true.
Gets the logging function for the server.
The default logging level is .
A that provides the logging function.
Gets the port of the server.
An that represents the number of the port
on which to listen for incoming requests.
Gets or sets the realm used for authentication.
"SECRET AREA" is used as the realm if the value is
or an empty string.
The set operation does nothing if the server has
already started or it is shutting down.
A or by default.
That string represents the name of the realm.
Gets or sets a value indicating whether the server is allowed to
be bound to an address that is already in use.
You should set this property to true if you would
like to resolve to wait for socket in TIME_WAIT state.
The set operation does nothing if the server has already
started or it is shutting down.
true if the server is allowed to be bound to an address
that is already in use; otherwise, false.
The default value is false.
Gets the configuration for secure connections.
This configuration will be referenced when attempts to start,
so it must be configured before the start method is called.
A that represents
the configuration used to provide secure connections.
This instance does not provide secure connections.
Gets or sets the delegate used to find the credentials
for an identity.
No credentials are found if the method invoked by
the delegate returns or
the value is .
The set operation does nothing if the server has
already started or it is shutting down.
A Func<,
> delegate or
if not needed.
That delegate invokes the method called for finding
the credentials used to authenticate a client.
The default value is .
Gets or sets the time to wait for the response to the WebSocket Ping or
Close.
The set operation does nothing if the server has already started or
it is shutting down.
A to wait for the response.
The default value is the same as 1 second.
The value specified for a set operation is zero or less.
Gets the management function for the WebSocket services
provided by the server.
A that manages
the WebSocket services provided by the server.
Occurs when the server receives an HTTP CONNECT request.
Occurs when the server receives an HTTP DELETE request.
Occurs when the server receives an HTTP GET request.
Occurs when the server receives an HTTP HEAD request.
Occurs when the server receives an HTTP OPTIONS request.
Occurs when the server receives an HTTP PATCH request.
Occurs when the server receives an HTTP POST request.
Occurs when the server receives an HTTP PUT request.
Occurs when the server receives an HTTP TRACE request.
Adds a WebSocket service with the specified behavior,
, and .
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
A Func<TBehavior> delegate.
It invokes the method called for creating
a new session instance for the service.
The method must create a new instance of
the specified behavior class and return it.
The type of the behavior for the service.
It must inherit the class.
is .
-or-
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Adds a WebSocket service with the specified behavior and
.
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
The type of the behavior for the service.
It must inherit the class and
must have a public parameterless constructor.
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Adds a WebSocket service with the specified behavior,
, and .
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
An Action<TBehaviorWithNew> delegate or
if not needed.
That delegate invokes the method called for initializing
a new session instance for the service.
The type of the behavior for the service.
It must inherit the class and
must have a public parameterless constructor.
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Gets the contents of the specified file from the document
folder of the server.
An array of or
if it fails.
That array represents the contents of the file.
A that represents a virtual path to
find the file from the document folder.
is .
is an empty string.
-or-
contains "..".
Removes a WebSocket service with the specified .
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
The service is stopped with close status 1001 (going away)
if it has already started.
true if the service is successfully found and removed;
otherwise, false.
A that represents an absolute path to
the service to remove.
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
Starts receiving incoming requests.
This method does nothing if the server has already started or
it is shutting down.
There is no server certificate for secure connections.
-or-
The underlying has failed to start.
Stops receiving incoming requests and closes each connection.
This method does nothing if the server is not started,
it is shutting down, or it has already stopped.
Stops receiving incoming requests and closes each connection.
This method does nothing if the server is not started,
it is shutting down, or it has already stopped.
A that represents the status code
indicating the reason for the WebSocket connection close.
The status codes are defined in
Section 7.4 of RFC 6455.
A that represents the reason for
the WebSocket connection close.
The size must be 123 bytes or less in UTF-8.
is less than 1000 or greater than 4999.
-or-
The size of is greater than 123 bytes.
is 1010 (mandatory extension).
-or-
is 1005 (no status) and
there is .
-or-
could not be UTF-8-encoded.
Stops receiving incoming requests and closes each connection.
This method does nothing if the server is not started,
it is shutting down, or it has already stopped.
One of the enum values.
It represents the status code indicating the reason for
the WebSocket connection close.
A that represents the reason for
the WebSocket connection close.
The size must be 123 bytes or less in UTF-8.
The size of is greater than 123 bytes.
is
.
-or-
is
and
there is .
-or-
could not be UTF-8-encoded.
Exposes the properties used to access the information in a session in a WebSocket service.
Gets the information in the connection request to the WebSocket service.
A that provides the access to the connection request.
Gets the unique ID of the session.
A that represents the unique ID of the session.
Gets the WebSocket subprotocol used in the session.
A that represents the subprotocol if any.
Gets the time that the session has started.
A that represents the time that the session has started.
Gets the state of the used in the session.
One of the enum values, indicates the state of
the used in the session.
Exposes the methods and properties used to define the behavior of a WebSocket service
provided by the or .
The WebSocketBehavior class is an abstract class.
Initializes a new instance of the class.
Gets the logging functions.
A that provides the logging functions,
or if the WebSocket connection isn't established.
Gets the access to the sessions in the WebSocket service.
A that provides the access to the sessions,
or if the WebSocket connection isn't established.
Gets the information in a handshake request to the WebSocket service.
A instance that provides the access to the handshake request,
or if the WebSocket connection isn't established.
Gets or sets the delegate called to validate the HTTP cookies included in
a handshake request to the WebSocket service.
This delegate is called when the used in a session validates
the handshake request.
A Func<CookieCollection, CookieCollection, bool> delegate that references
the method(s) used to validate the cookies.
1st parameter passed to this delegate contains
the cookies to validate if any.
2nd parameter passed to this delegate receives
the cookies to send to the client.
This delegate should return true if the cookies are valid.
The default value is , and it does nothing to validate.
Gets or sets a value indicating whether the used in a session emits
a event when receives a Ping.
true if the emits a event
when receives a Ping; otherwise, false. The default value is false.
Gets the unique ID of a session.
A that represents the unique ID of the session,
or if the WebSocket connection isn't established.
Gets or sets a value indicating whether the WebSocket service ignores
the Sec-WebSocket-Extensions header included in a handshake request.
true if the WebSocket service ignores the extensions requested from
a client; otherwise, false. The default value is false.
Gets or sets the delegate called to validate the Origin header included in
a handshake request to the WebSocket service.
This delegate is called when the used in a session validates
the handshake request.
A Func<string, bool> delegate that references the method(s) used to
validate the origin header.
parameter passed to this delegate represents the value of
the origin header to validate if any.
This delegate should return true if the origin header is valid.
The default value is , and it does nothing to validate.
Gets or sets the WebSocket subprotocol used in the WebSocket service.
Set operation of this property is available before the WebSocket connection has
been established.
A that represents the subprotocol if any.
The default value is .
The value to set must be a token defined in
RFC 2616.
Gets the time that a session has started.
A that represents the time that the session has started,
or if the WebSocket connection isn't established.
Gets the state of the used in a session.
One of the enum values, indicates the state of
the .
Calls the method with the specified and
.
This method doesn't call the method if is
or empty.
A that represents the error message.
An instance that represents the cause of the error if any.
Called when the WebSocket connection used in a session has been closed.
A that represents the event data passed to
a event.
Called when the used in a session gets an error.
A that represents the event data passed to
a event.
Called when the used in a session receives a message.
A that represents the event data passed to
a event.
Called when the WebSocket connection used in a session has been established.
Sends binary to the client on a session.
This method is available after the WebSocket connection has been established.
An array of that represents the binary data to send.
Sends the specified as binary data to the client on a session.
This method is available after the WebSocket connection has been established.
A that represents the file to send.
Sends text to the client on a session.
This method is available after the WebSocket connection has been established.
A that represents the text data to send.
Sends binary asynchronously to the client on a session.
This method is available after the WebSocket connection has been established.
This method doesn't wait for the send to be complete.
An array of that represents the binary data to send.
An Action<bool> delegate that references the method(s) called when
the send is complete. A passed to this delegate is true
if the send is complete successfully.
Sends the specified as binary data asynchronously to
the client on a session.
This method is available after the WebSocket connection has been established.
This method doesn't wait for the send to be complete.
A that represents the file to send.
An Action<bool> delegate that references the method(s) called when
the send is complete. A passed to this delegate is true
if the send is complete successfully.
Sends text asynchronously to the client on a session.
This method is available after the WebSocket connection has been established.
This method doesn't wait for the send to be complete.
A that represents the text data to send.
An Action<bool> delegate that references the method(s) called when
the send is complete. A passed to this delegate is true
if the send is complete successfully.
Sends binary data from the specified asynchronously to
the client on a session.
This method is available after the WebSocket connection has been established.
This method doesn't wait for the send to be complete.
A from which contains the binary data to send.
An that represents the number of bytes to send.
An Action<bool> delegate that references the method(s) called when
the send is complete. A passed to this delegate is true
if the send is complete successfully.
Provides a WebSocket protocol server.
This class can provide multiple WebSocket services.
Initializes a new instance of the class.
The new instance listens for incoming handshake requests on
and port 80.
Initializes a new instance of the class
with the specified .
The new instance listens for incoming handshake requests on
and .
It provides secure connections if is 443.
An that represents the number of the port
on which to listen.
is less than 1 or greater than 65535.
Initializes a new instance of the class
with the specified .
The new instance listens for incoming handshake requests on
the IP address of the host of and
the port of .
Either port 80 or 443 is used if includes
no port. Port 443 is used if the scheme of
is wss; otherwise, port 80 is used.
The new instance provides secure connections if the scheme of
is wss.
A that represents the WebSocket URL of the server.
is .
is an empty string.
-or-
is invalid.
Initializes a new instance of the class
with the specified and .
The new instance listens for incoming handshake requests on
and .
An that represents the number of the port
on which to listen.
A : true if the new instance provides
secure connections; otherwise, false.
is less than 1 or greater than 65535.
Initializes a new instance of the class
with the specified and .
The new instance listens for incoming handshake requests on
and .
It provides secure connections if is 443.
A that represents the local
IP address on which to listen.
An that represents the number of the port
on which to listen.
is .
is not a local IP address.
is less than 1 or greater than 65535.
Initializes a new instance of the class
with the specified , ,
and .
The new instance listens for incoming handshake requests on
and .
A that represents the local
IP address on which to listen.
An that represents the number of the port
on which to listen.
A : true if the new instance provides
secure connections; otherwise, false.
is .
is not a local IP address.
is less than 1 or greater than 65535.
Gets the IP address of the server.
A that represents the local
IP address on which to listen for incoming handshake requests.
Gets or sets a value indicating whether the server accepts every
handshake request without checking the request URI.
The set operation does nothing if the server has already started or
it is shutting down.
true if the server accepts every handshake request without
checking the request URI; otherwise, false.
The default value is false.
Gets or sets the scheme used to authenticate the clients.
The set operation does nothing if the server has already started or
it is shutting down.
One of the
enum values.
It represents the scheme used to authenticate the clients.
The default value is
.
Gets a value indicating whether the server has started.
true if the server has started; otherwise, false.
Gets a value indicating whether the server provides
secure connections.
true if the server provides secure connections;
otherwise, false.
Gets or sets a value indicating whether the server cleans up
the inactive sessions periodically.
The set operation does nothing if the server has already started or
it is shutting down.
true if the server cleans up the inactive sessions every
60 seconds; otherwise, false.
The default value is true.
Gets the logging function for the server.
The default logging level is .
A that provides the logging function.
Gets the port of the server.
An that represents the number of the port
on which to listen for incoming handshake requests.
Gets or sets the realm used for authentication.
"SECRET AREA" is used as the realm if the value is
or an empty string.
The set operation does nothing if the server has
already started or it is shutting down.
A or by default.
That string represents the name of the realm.
Gets or sets a value indicating whether the server is allowed to
be bound to an address that is already in use.
You should set this property to true if you would
like to resolve to wait for socket in TIME_WAIT state.
The set operation does nothing if the server has already
started or it is shutting down.
true if the server is allowed to be bound to an address
that is already in use; otherwise, false.
The default value is false.
Gets the configuration for secure connections.
This configuration will be referenced when attempts to start,
so it must be configured before the start method is called.
A that represents
the configuration used to provide secure connections.
This instance does not provide secure connections.
Gets or sets the delegate used to find the credentials
for an identity.
No credentials are found if the method invoked by
the delegate returns or
the value is .
The set operation does nothing if the server has
already started or it is shutting down.
A Func<,
> delegate or
if not needed.
That delegate invokes the method called for finding
the credentials used to authenticate a client.
The default value is .
Gets or sets the time to wait for the response to the WebSocket Ping or
Close.
The set operation does nothing if the server has already started or
it is shutting down.
A to wait for the response.
The default value is the same as 1 second.
The value specified for a set operation is zero or less.
Gets the management function for the WebSocket services
provided by the server.
A that manages
the WebSocket services provided by the server.
Adds a WebSocket service with the specified behavior,
, and .
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
A Func<TBehavior> delegate.
It invokes the method called for creating a new session
instance for the service.
The method must create a new instance of the specified
behavior class and return it.
The type of the behavior for the service.
It must inherit the class.
is .
-or-
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Adds a WebSocket service with the specified behavior and
.
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
The type of the behavior for the service.
It must inherit the class and
have a public parameterless constructor.
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Adds a WebSocket service with the specified behavior,
, and .
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
An Action<TBehaviorWithNew> delegate or
if not needed.
That delegate invokes the method called for initializing
a new session instance for the service.
The type of the behavior for the service.
It must inherit the class and
have a public parameterless constructor.
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Removes a WebSocket service with the specified .
is converted to a URL-decoded string and
'/' is trimmed from the end of the converted string if any.
The service is stopped with close status 1001 (going away)
if it has already started.
true if the service is successfully found and removed;
otherwise, false.
A that represents an absolute path to
the service to remove.
is .
is an empty string.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
Starts receiving incoming handshake requests.
This method does nothing if the server has already started or
it is shutting down.
There is no server certificate for secure connections.
-or-
The underlying has failed to start.
Stops receiving incoming handshake requests and closes
each connection.
This method does nothing if the server is not started,
it is shutting down, or it has already stopped.
The underlying has failed to stop.
Stops receiving incoming handshake requests and closes each
connection with the specified and
.
This method does nothing if the server is not started,
it is shutting down, or it has already stopped.
A that represents the status code
indicating the reason for the close.
The status codes are defined in
Section 7.4 of RFC 6455.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is less than 1000 or greater than 4999.
-or-
The size of is greater than 123 bytes.
is 1010 (mandatory extension).
-or-
is 1005 (no status) and
there is .
-or-
could not be UTF-8-encoded.
The underlying has failed to stop.
Stops receiving incoming handshake requests and closes each
connection with the specified and
.
This method does nothing if the server is not started,
it is shutting down, or it has already stopped.
One of the enum values.
It represents the status code indicating the reason for the close.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is
.
-or-
is
and
there is .
-or-
could not be UTF-8-encoded.
The size of is greater than 123 bytes.
The underlying has failed to stop.
Exposes the methods and properties used to access the information in
a WebSocket service provided by the or
.
This class is an abstract class.
Initializes a new instance of the class
with the specified and .
A that represents the absolute path to the service.
A that represents the logging function for the service.
Gets the logging function for the service.
A that provides the logging function.
Gets or sets a value indicating whether the service cleans up
the inactive sessions periodically.
The set operation does nothing if the service has already started or
it is shutting down.
true if the service cleans up the inactive sessions every
60 seconds; otherwise, false.
Gets the path to the service.
A that represents the absolute path to
the service.
Gets the management function for the sessions in the service.
A that manages the sessions in
the service.
Gets the of the behavior of the service.
A that represents the type of the behavior of
the service.
Gets or sets the time to wait for the response to the WebSocket Ping or
Close.
The set operation does nothing if the service has already started or
it is shutting down.
A to wait for the response.
The value specified for a set operation is zero or less.
Creates a new session for the service.
A instance that represents
the new session.
Provides the management function for the WebSocket services.
This class manages the WebSocket services provided by
the or .
Gets the number of the WebSocket services.
An that represents the number of the services.
Gets the host instances for the WebSocket services.
An IEnumerable<WebSocketServiceHost> instance.
It provides an enumerator which supports the iteration over
the collection of the host instances.
Gets the host instance for a WebSocket service with
the specified .
is converted to a URL-decoded string and
/ is trimmed from the end of the converted string if any.
A instance or
if not found.
That host instance provides the function to access
the information in the service.
A that represents an absolute path to
the service to find.
is .
is empty.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
Gets or sets a value indicating whether the inactive sessions in
the WebSocket services are cleaned up periodically.
The set operation does nothing if the server has already started or
it is shutting down.
true if the inactive sessions are cleaned up every 60 seconds;
otherwise, false.
Gets the paths for the WebSocket services.
An IEnumerable<string> instance.
It provides an enumerator which supports the iteration over
the collection of the paths.
Gets the total number of the sessions in the WebSocket services.
An that represents the total number of
the sessions in the services.
Gets or sets the time to wait for the response to the WebSocket Ping or
Close.
The set operation does nothing if the server has already started or
it is shutting down.
A to wait for the response.
The value specified for a set operation is zero or less.
Adds a WebSocket service with the specified behavior,
, and .
is converted to a URL-decoded string and
/ is trimmed from the end of the converted string if any.
A that represents an absolute path to
the service to add.
An Action<TBehavior> delegate or
if not needed.
That delegate invokes the method called for initializing
a new session instance for the service.
The type of the behavior for the service. It must inherit
the class and it must have
a public parameterless constructor.
is .
is empty.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
-or-
is already in use.
Sends to every client in the WebSocket services.
An array of that represents the binary data to send.
The current state of the manager is not Start.
is .
Sends to every client in the WebSocket services.
A that represents the text data to send.
The current state of the manager is not Start.
is .
could not be UTF-8-encoded.
Sends asynchronously to every client in
the WebSocket services.
This method does not wait for the send to be complete.
An array of that represents the binary data to send.
An delegate or
if not needed.
The delegate invokes the method called when the send is complete.
The current state of the manager is not Start.
is .
Sends asynchronously to every client in
the WebSocket services.
This method does not wait for the send to be complete.
A that represents the text data to send.
An delegate or
if not needed.
The delegate invokes the method called when the send is complete.
The current state of the manager is not Start.
is .
could not be UTF-8-encoded.
Sends the data from asynchronously to
every client in the WebSocket services.
The data is sent as the binary data.
This method does not wait for the send to be complete.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
An delegate or
if not needed.
The delegate invokes the method called when the send is complete.
The current state of the manager is not Start.
is .
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
Sends a ping to every client in the WebSocket services.
A Dictionary<string, Dictionary<string, bool>>.
It represents a collection of pairs of a service path and another
collection of pairs of a session ID and a value indicating whether
a pong has been received from the client within a time.
The current state of the manager is not Start.
Sends a ping with to every client in
the WebSocket services.
A Dictionary<string, Dictionary<string, bool>>.
It represents a collection of pairs of a service path and another
collection of pairs of a session ID and a value indicating whether
a pong has been received from the client within a time.
A that represents the message to send.
The size must be 125 bytes or less in UTF-8.
The current state of the manager is not Start.
could not be UTF-8-encoded.
The size of is greater than 125 bytes.
Removes all WebSocket services managed by the manager.
A service is stopped with close status 1001 (going away)
if it has already started.
Removes a WebSocket service with the specified .
is converted to a URL-decoded string and
/ is trimmed from the end of the converted string if any.
The service is stopped with close status 1001 (going away)
if it has already started.
true if the service is successfully found and removed;
otherwise, false.
A that represents an absolute path to
the service to remove.
is .
is empty.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
Tries to get the host instance for a WebSocket service with
the specified .
is converted to a URL-decoded string and
/ is trimmed from the end of the converted string if any.
true if the service is successfully found;
otherwise, false.
A that represents an absolute path to
the service to find.
When this method returns, a
instance or if not found.
That host instance provides the function to access
the information in the service.
is .
is empty.
-or-
is not an absolute path.
-or-
includes either or both
query and fragment components.
Provides the management function for the sessions in a WebSocket service.
This class manages the sessions in a WebSocket service provided by
the or .
Gets the IDs for the active sessions in the WebSocket service.
An IEnumerable<string> instance.
It provides an enumerator which supports the iteration over
the collection of the IDs for the active sessions.
Gets the number of the sessions in the WebSocket service.
An that represents the number of the sessions.
Gets the IDs for the sessions in the WebSocket service.
An IEnumerable<string> instance.
It provides an enumerator which supports the iteration over
the collection of the IDs for the sessions.
Gets the IDs for the inactive sessions in the WebSocket service.
An IEnumerable<string> instance.
It provides an enumerator which supports the iteration over
the collection of the IDs for the inactive sessions.
Gets the session instance with .
A instance or
if not found.
The session instance provides the function to access the information
in the session.
A that represents the ID of the session to find.
is .
is an empty string.
Gets or sets a value indicating whether the inactive sessions in
the WebSocket service are cleaned up periodically.
The set operation does nothing if the service has already started or
it is shutting down.
true if the inactive sessions are cleaned up every 60 seconds;
otherwise, false.
Gets the session instances in the WebSocket service.
An IEnumerable<IWebSocketSession> instance.
It provides an enumerator which supports the iteration over
the collection of the session instances.
Gets or sets the time to wait for the response to the WebSocket Ping or
Close.
The set operation does nothing if the service has already started or
it is shutting down.
A to wait for the response.
The value specified for a set operation is zero or less.
Sends to every client in the WebSocket service.
An array of that represents the binary data to send.
The current state of the manager is not Start.
is .
Sends to every client in the WebSocket service.
A that represents the text data to send.
The current state of the manager is not Start.
is .
could not be UTF-8-encoded.
Sends the data from to every client in
the WebSocket service.
The data is sent as the binary data.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
The current state of the manager is not Start.
is .
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
Sends asynchronously to every client in
the WebSocket service.
This method does not wait for the send to be complete.
An array of that represents the binary data to send.
An delegate or
if not needed.
The delegate invokes the method called when the send is complete.
The current state of the manager is not Start.
is .
Sends asynchronously to every client in
the WebSocket service.
This method does not wait for the send to be complete.
A that represents the text data to send.
An delegate or
if not needed.
The delegate invokes the method called when the send is complete.
The current state of the manager is not Start.
is .
could not be UTF-8-encoded.
Sends the data from asynchronously to
every client in the WebSocket service.
The data is sent as the binary data.
This method does not wait for the send to be complete.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
An delegate or
if not needed.
The delegate invokes the method called when the send is complete.
The current state of the manager is not Start.
is .
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
Sends a ping to every client in the WebSocket service.
A Dictionary<string, bool>.
It represents a collection of pairs of a session ID and
a value indicating whether a pong has been received from
the client within a time.
The current state of the manager is not Start.
Sends a ping with to every client in
the WebSocket service.
A Dictionary<string, bool>.
It represents a collection of pairs of a session ID and
a value indicating whether a pong has been received from
the client within a time.
A that represents the message to send.
The size must be 125 bytes or less in UTF-8.
The current state of the manager is not Start.
could not be UTF-8-encoded.
The size of is greater than 125 bytes.
Closes the specified session.
A that represents the ID of the session to close.
is .
is an empty string.
The session could not be found.
Closes the specified session with and
.
A that represents the ID of the session to close.
A that represents the status code indicating
the reason for the close.
The status codes are defined in
Section 7.4 of RFC 6455.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is .
is an empty string.
-or-
is 1010 (mandatory extension).
-or-
is 1005 (no status) and there is
.
-or-
could not be UTF-8-encoded.
The session could not be found.
is less than 1000 or greater than 4999.
-or-
The size of is greater than 123 bytes.
Closes the specified session with and
.
A that represents the ID of the session to close.
One of the enum values.
It represents the status code indicating the reason for the close.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is .
is an empty string.
-or-
is
.
-or-
is
and there is
.
-or-
could not be UTF-8-encoded.
The session could not be found.
The size of is greater than 123 bytes.
Sends a ping to the client using the specified session.
true if the send has done with no error and a pong has been
received from the client within a time; otherwise, false.
A that represents the ID of the session.
is .
is an empty string.
The session could not be found.
Sends a ping with to the client using
the specified session.
true if the send has done with no error and a pong has been
received from the client within a time; otherwise, false.
A that represents the message to send.
The size must be 125 bytes or less in UTF-8.
A that represents the ID of the session.
is .
is an empty string.
-or-
could not be UTF-8-encoded.
The session could not be found.
The size of is greater than 125 bytes.
Sends to the client using the specified session.
An array of that represents the binary data to send.
A that represents the ID of the session.
is .
-or-
is .
is an empty string.
The session could not be found.
-or-
The current state of the WebSocket connection is not Open.
Sends to the client using the specified session.
A that represents the text data to send.
A that represents the ID of the session.
is .
-or-
is .
is an empty string.
-or-
could not be UTF-8-encoded.
The session could not be found.
-or-
The current state of the WebSocket connection is not Open.
Sends the data from to the client using
the specified session.
The data is sent as the binary data.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
A that represents the ID of the session.
is .
-or-
is .
is an empty string.
-or-
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
The session could not be found.
-or-
The current state of the WebSocket connection is not Open.
Sends asynchronously to the client using
the specified session.
This method does not wait for the send to be complete.
An array of that represents the binary data to send.
A that represents the ID of the session.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
is .
-or-
is .
is an empty string.
The session could not be found.
-or-
The current state of the WebSocket connection is not Open.
Sends asynchronously to the client using
the specified session.
This method does not wait for the send to be complete.
A that represents the text data to send.
A that represents the ID of the session.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
is .
-or-
is .
is an empty string.
-or-
could not be UTF-8-encoded.
The session could not be found.
-or-
The current state of the WebSocket connection is not Open.
Sends the data from asynchronously to
the client using the specified session.
The data is sent as the binary data.
This method does not wait for the send to be complete.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
A that represents the ID of the session.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
is .
-or-
is .
is an empty string.
-or-
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
The session could not be found.
-or-
The current state of the WebSocket connection is not Open.
Cleans up the inactive sessions in the WebSocket service.
Tries to get the session instance with .
true if the session is successfully found; otherwise,
false.
A that represents the ID of the session to find.
When this method returns, a
instance or if not found.
The session instance provides the function to access
the information in the session.
is .
is an empty string.
Implements the WebSocket interface.
The WebSocket class provides a set of methods and properties for two-way communication using
the WebSocket protocol (RFC 6455).
Represents the empty array of used internally.
Represents the length used to determine whether the data should be fragmented in sending.
The data will be fragmented if that length is greater than the value of this field.
If you would like to change the value, you must set it to a value between 125 and
Int32.MaxValue - 14 inclusive.
Represents the random number generator used internally.
Initializes a new instance of the class with
and .
A that specifies the URL of the WebSocket
server to connect.
An array of that specifies the names of
the subprotocols if necessary.
Each value of the array must be a token defined in
RFC 2616.
is .
is an empty string.
-or-
is an invalid WebSocket URL string.
-or-
contains a value that is not a token.
-or-
contains a value twice.
Gets or sets the compression method used to compress a message.
The set operation does nothing if the connection has already been
established or it is closing.
One of the enum values.
It represents the compression method used to compress a message.
The default value is .
The set operation cannot be used by servers.
Gets the HTTP cookies included in the WebSocket handshake request and response.
An
instance that provides an enumerator which supports the iteration over the collection of
the cookies.
Gets the credentials for the HTTP authentication (Basic/Digest).
A that represents the credentials for
the authentication. The default value is .
Gets or sets a value indicating whether the emits
a event when receives a ping.
true if the emits a event
when receives a ping; otherwise, false. The default value is false.
Gets or sets a value indicating whether the URL redirection for
the handshake request is allowed.
The set operation does nothing if the connection has already been
established or it is closing.
true if the URL redirection for the handshake request is
allowed; otherwise, false.
The default value is false.
The set operation cannot be used by servers.
Gets the WebSocket extensions selected by the server.
A that represents the extensions if any.
The default value is .
Gets a value indicating whether the WebSocket connection is alive.
true if the connection is alive; otherwise, false.
Gets a value indicating whether the WebSocket connection is secure.
true if the connection is secure; otherwise, false.
Gets the logging functions.
The default logging level is . If you would like to change it,
you should set this Log.Level property to any of the enum
values.
A that provides the logging functions.
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.
This instance sends the Origin header if this property has any.
The set operation does nothing if the connection has already been
established or it is closing.
A that represents the value of the Origin
header to send.
The syntax is <scheme>://<host>[:<port>].
The default value is .
The set operation is not available if this instance is not a client.
The value specified for a set operation is not an absolute URI string.
-or-
The value specified for a set operation includes the path segments.
Gets the WebSocket subprotocol selected by the server.
A that represents the subprotocol if any.
The default value is .
Gets the state of the WebSocket connection.
One of the enum values that indicates
the current state of the connection. The default value is
.
Gets the configuration for secure connection.
This configuration will be referenced when attempts to connect,
so it must be configured before any connect method is called.
A that represents
the configuration used to establish a secure connection.
This instance is not a client.
This instance does not use a secure connection.
Gets the WebSocket URL used to connect, or accepted.
A that represents the URL used to connect, or accepted.
Gets or sets the time to wait for the response to the ping or close.
The set operation does nothing if the connection has already been
established or it is closing.
A to wait for the response.
The default value is the same as 5 seconds if the instance is
a client.
The value specified for a set operation is zero or less.
Occurs when the WebSocket connection has been closed.
Occurs when the gets an error.
Occurs when the receives a message.
Occurs when the WebSocket connection has been established.
Accepts the WebSocket handshake request.
This method is not available in a client.
Accepts the WebSocket handshake request asynchronously.
This method does not wait for the accept to be complete.
This method is not available in a client.
Closes the connection.
This method does nothing if the current state of the connection is
Closing or Closed.
Closes the connection with the specified .
This method does nothing if the current state of the connection is
Closing or Closed.
A that represents the status code
indicating the reason for the close.
The status codes are defined in
Section 7.4 of RFC 6455.
is less than 1000 or greater than 4999.
is 1011 (server error).
It cannot be used by clients.
-or-
is 1010 (mandatory extension).
It cannot be used by servers.
Closes the connection with the specified .
This method does nothing if the current state of the connection is
Closing or Closed.
One of the enum values.
It represents the status code indicating the reason for the close.
is
.
It cannot be used by clients.
-or-
is
.
It cannot be used by servers.
Closes the connection with the specified and
.
This method does nothing if the current state of the connection is
Closing or Closed.
A that represents the status code
indicating the reason for the close.
The status codes are defined in
Section 7.4 of RFC 6455.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is less than 1000 or greater than 4999.
-or-
The size of is greater than 123 bytes.
is 1011 (server error).
It cannot be used by clients.
-or-
is 1010 (mandatory extension).
It cannot be used by servers.
-or-
is 1005 (no status) and
there is .
-or-
could not be UTF-8-encoded.
Closes the connection with the specified and
.
This method does nothing if the current state of the connection is
Closing or Closed.
One of the enum values.
It represents the status code indicating the reason for the close.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is
.
It cannot be used by clients.
-or-
is
.
It cannot be used by servers.
-or-
is
and
there is .
-or-
could not be UTF-8-encoded.
The size of is greater than 123 bytes.
Closes the connection asynchronously.
This method does not wait for the close to be complete.
And this method does nothing if the current state of
the connection is Closing or Closed.
Closes the connection asynchronously with the specified
.
This method does not wait for the close to be complete.
And this method does nothing if the current state of
the connection is Closing or Closed.
A that represents the status code
indicating the reason for the close.
The status codes are defined in
Section 7.4 of RFC 6455.
is less than 1000 or greater than 4999.
is 1011 (server error).
It cannot be used by clients.
-or-
is 1010 (mandatory extension).
It cannot be used by servers.
Closes the connection asynchronously with the specified
.
This method does not wait for the close to be complete.
And this method does nothing if the current state of
the connection is Closing or Closed.
One of the enum values.
It represents the status code indicating the reason for the close.
is
.
It cannot be used by clients.
-or-
is
.
It cannot be used by servers.
Closes the connection asynchronously with the specified
and .
This method does not wait for the close to be complete.
And this method does nothing if the current state of
the connection is Closing or Closed.
A that represents the status code
indicating the reason for the close.
The status codes are defined in
Section 7.4 of RFC 6455.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is less than 1000 or greater than 4999.
-or-
The size of is greater than 123 bytes.
is 1011 (server error).
It cannot be used by clients.
-or-
is 1010 (mandatory extension).
It cannot be used by servers.
-or-
is 1005 (no status) and
there is .
-or-
could not be UTF-8-encoded.
Closes the connection asynchronously with the specified
and .
This method does not wait for the close to be complete.
And this method does nothing if the current state of
the connection is Closing or Closed.
One of the enum values.
It represents the status code indicating the reason for the close.
A that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
is
.
It cannot be used by clients.
-or-
is
.
It cannot be used by servers.
-or-
is
and
there is .
-or-
could not be UTF-8-encoded.
The size of is greater than 123 bytes.
Establishes a WebSocket connection.
This method is not available in a server.
Establishes a WebSocket connection asynchronously.
This method does not wait for the connect to be complete.
This method is not available in a server.
Sends a ping using the WebSocket connection.
true if the send has done with no error and a pong has been
received within a time; otherwise, false.
Sends a ping with using the WebSocket
connection.
true if the send has done with no error and a pong has been
received within a time; otherwise, false.
A that represents the message to send.
The size must be 125 bytes or less in UTF-8.
could not be UTF-8-encoded.
The size of is greater than 125 bytes.
Sends using the WebSocket connection.
An array of that represents the binary data to send.
The current state of the connection is not Open.
is .
Sends the specified file using the WebSocket connection.
The file is sent as the binary data.
A that specifies the file to send.
The current state of the connection is not Open.
is .
The file does not exist.
-or-
The file could not be opened.
Sends using the WebSocket connection.
A that represents the text data to send.
The current state of the connection is not Open.
is .
could not be UTF-8-encoded.
Sends the data from using the WebSocket
connection.
The data is sent as the binary data.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
The current state of the connection is not Open.
is .
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
Sends asynchronously using the WebSocket
connection.
This method does not wait for the send to be complete.
An array of that represents the binary data to send.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
The current state of the connection is not Open.
is .
Sends the specified file asynchronously using the WebSocket connection.
The file is sent as the binary data.
This method does not wait for the send to be complete.
A that specifies the file to send.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
The current state of the connection is not Open.
is .
The file does not exist.
-or-
The file could not be opened.
Sends asynchronously using the WebSocket
connection.
This method does not wait for the send to be complete.
A that represents the text data to send.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
The current state of the connection is not Open.
is .
could not be UTF-8-encoded.
Sends the data from asynchronously using
the WebSocket connection.
The data is sent as the binary data.
This method does not wait for the send to be complete.
A instance from which to read the data to send.
An that specifies the number of bytes to send.
An Action<bool> delegate or
if not needed.
The delegate invokes the method called when the send is complete.
true is passed to the method if the send has done with
no error; otherwise, false.
The current state of the connection is not Open.
is .
cannot be read.
-or-
is less than 1.
-or-
No data could be read from .
Sets an HTTP to send with
the WebSocket handshake request to the server.
This method is not available in a server.
A that represents a cookie to send.
Sets a pair of and for
the HTTP authentication (Basic/Digest).
This method is not available in a server.
A that represents the user name used to authenticate.
If is or empty,
the credentials will be initialized and not be sent.
A that represents the password for
used to authenticate.
true if the sends the credentials for
the Basic authentication with the first handshake request to the server;
otherwise, false.
Sets the HTTP proxy server URL to connect through, and if necessary,
a pair of and for
the proxy server authentication (Basic/Digest).
This method is not available in a server.
A that represents the HTTP proxy server URL to
connect through. The syntax must be http://<host>[:<port>].
If is or empty,
the url and credentials for the proxy will be initialized,
and the will not use the proxy to
connect through.
A that represents the user name used to authenticate.
If is or empty,
the credentials for the proxy will be initialized and not be sent.
A that represents the password for
used to authenticate.
Closes the connection and releases all associated resources.
This method closes the connection with close status 1001 (going away).
And this method does nothing if the current state of the connection is
Closing or Closed.
The exception that is thrown when a fatal error occurs in
the WebSocket communication.
Gets the status code indicating the cause of the exception.
One of the enum values that represents
the status code indicating the cause of the exception.
Represents the ping frame without the payload data as an array of .
The value of this field is created from a non masked frame, so it can only be used to
send a ping from a server.
Indicates the state of a WebSocket connection.
The values of this enumeration are defined in
The WebSocket API.
Equivalent to numeric value 0. Indicates that the connection has not
yet been established.
Equivalent to numeric value 1. Indicates that the connection has
been established, and the communication is possible.
Equivalent to numeric value 2. Indicates that the connection is
going through the closing handshake, or the close method has
been invoked.
Equivalent to numeric value 3. Indicates that the connection has
been closed or could not be established.