websocket-sharp : WebSocketSharp.Server Namespace

WebSocketServerBase Class

Provides the basic functions of the server that receives the WebSocket connection requests.

Syntax

public abstract class WebSocketServerBase

Remarks

The WebSocketServerBase class is an abstract class.

Requirements

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

Members

See Also: Inherited members from object.

Protected Constructors

Initializes a new instance of the WebSocketSharp.Server.WebSocketServerBase class.
Initializes a new instance of the WebSocketSharp.Server.WebSocketServerBase class that listens for incoming connection attempts on the specified WebSocket URL.
Initializes a new instance of the WebSocketSharp.Server.WebSocketServerBase class that listens for incoming connection attempts on the specified address, port, absPath and secure.

Public Properties

[read-only]
Address System.Net.IPAddress . Gets the local IP address on which to listen for incoming connection attempts.
[read-only]
IsSecure bool . Gets a value indicating whether this server is secure.
[read-only]
IsSelfHost bool . Gets a value indicating whether this server is self host.
[read-only]
Port int . Gets the port on which to listen for incoming connection attempts.

Protected Properties

BaseUri Uri . Gets or sets the WebSocket URL on which to listen for incoming connection attempts.

Public Methods

Start ()
Starts to receive the WebSocket connection requests.
Stop ()
Stops receiving the WebSocket connection requests.

Protected Methods

abstract
AcceptWebSocket (System.Net.Sockets.TcpClient)
Accepts the WebSocket connection.
Error (string)
Occurs the WebSocketServerBase.OnError event with the specified message.

Public Events

OnError Occurs when this server gets an error.

Extension Methods

static
IsNull<T> (this T) : bool
Determines whether the specified object is null.
static
IsNullDo<T> (this T, Action) : bool
Determines whether the specified object is null. And invokes the specified Action delegate if the specified object is null.

Member Details

WebSocketServerBase Constructor

Initializes a new instance of the WebSocketSharp.Server.WebSocketServerBase class.

Syntax

protected WebSocketServerBase ()

Remarks

Documentation for this section has not yet been entered.

Requirements

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

WebSocketServerBase Constructor

Initializes a new instance of the WebSocketSharp.Server.WebSocketServerBase class that listens for incoming connection attempts on the specified WebSocket URL.

Syntax

protected WebSocketServerBase (string url)

Parameters

url
A string that contains a WebSocket URL.

Exceptions

Type Reason
ArgumentNullException url is null.
ArgumentException url is invalid.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

WebSocketServerBase Constructor

Initializes a new instance of the WebSocketSharp.Server.WebSocketServerBase class that listens for incoming connection attempts on the specified address, port, absPath and secure.

Syntax

protected WebSocketServerBase (System.Net.IPAddress address, int port, string absPath, bool secure)

Parameters

address
An System.Net.IPAddress that contains a local IP address.
port
An int that contains a port number.
absPath
A string that contains a absolute path.
secure
A bool that indicates providing a secure connection or not. (true indicates providing a secure connection.)

Exceptions

Type Reason
ArgumentNullException Either address or absPath is null.
ArgumentException

absPath is invalid.

-or-

Pair of port and secure is invalid.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

AcceptWebSocket Method

Accepts the WebSocket connection.

Syntax

protected abstract void AcceptWebSocket (System.Net.Sockets.TcpClient client)

Parameters

client
A System.Net.Sockets.TcpClient that contains the WebSocket connection.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Address Property

Gets the local IP address on which to listen for incoming connection attempts.

Syntax

public System.Net.IPAddress Address { get; }

Value

A System.Net.IPAddress that contains a local IP address.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

BaseUri Property

Gets or sets the WebSocket URL on which to listen for incoming connection attempts.

Syntax

protected Uri BaseUri { get; set; }

Value

A Uri that contains a WebSocket URL.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Error Method

Occurs the WebSocketServerBase.OnError event with the specified message.

Syntax

protected virtual void Error (string message)

Parameters

message
A string that contains an error message.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

IsSecure Property

Gets a value indicating whether this server is secure.

Syntax

public bool IsSecure { get; }

Value

true if this server is secure; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

IsSelfHost Property

Gets a value indicating whether this server is self host.

Syntax

public bool IsSelfHost { get; }

Value

true if this server is self host; otherwise, false.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

OnError Event

Occurs when this server gets an error.

Syntax

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Port Property

Gets the port on which to listen for incoming connection attempts.

Syntax

public int Port { get; }

Value

An int that contains a port number.

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Start Method

Starts to receive the WebSocket connection requests.

Syntax

public virtual void Start ()

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Stop Method

Stops receiving the WebSocket connection requests.

Syntax

public virtual void Stop ()

Remarks

Documentation for this section has not yet been entered.

Requirements

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