C# Class WebSocketSharp.Server.WebSocketServerBase

Provides the basic functions of the server that receives the WebSocket connection requests.
The WebSocketServerBase class is an abstract class.
Datei anzeigen Open project: NIAEFEUP/Kommando

Public Methods

Method Description
Start ( ) : void

Starts to receive the WebSocket connection requests.

Stop ( ) : void

Stops receiving the WebSocket connection requests.

Protected Methods

Method Description
AcceptWebSocket ( TcpListenerWebSocketContext context ) : void

Accepts a WebSocket connection request.

WebSocketServerBase ( ) : System

Initializes a new instance of the WebSocketServerBase class.

This constructor initializes a new instance of this class as non self hosted server.

WebSocketServerBase ( IPAddress address, int port, string servicePath, bool secure ) : System

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

WebSocketServerBase ( System.Logger logger ) : System

Initializes a new instance of the WebSocketServerBase class with the specified logger.

This constructor initializes a new instance of this class as non self hosted server.

WebSocketServerBase ( string url ) : System

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

Private Methods

Method Description
init ( ) : void
init ( Uri uri ) : void
processRequestAsync ( TcpClient client ) : void
receiveRequest ( ) : void
startReceiveRequestThread ( ) : void
tryCreateUri ( string uriString, Uri &result, string &message ) : bool

Method Details

AcceptWebSocket() protected abstract method

Accepts a WebSocket connection request.
protected abstract AcceptWebSocket ( TcpListenerWebSocketContext context ) : void
context WebSocketSharp.Net.WebSockets.TcpListenerWebSocketContext /// A that contains the WebSocket connection request objects. ///
return void

Start() public method

Starts to receive the WebSocket connection requests.
public Start ( ) : void
return void

Stop() public method

Stops receiving the WebSocket connection requests.
public Stop ( ) : void
return void

WebSocketServerBase() protected method

Initializes a new instance of the WebSocketServerBase class.
This constructor initializes a new instance of this class as non self hosted server.
protected WebSocketServerBase ( ) : System
return System

WebSocketServerBase() protected method

Initializes a new instance of the WebSocketServerBase class that listens for incoming connection attempts on the specified address, port, servicePath and secure.
/// Either or is . /// /// is 0 or less, or 65536 or greater. /// /// /// is invalid. /// /// /// -or- /// /// /// Pair of and is invalid. /// ///
protected WebSocketServerBase ( IPAddress address, int port, string servicePath, bool secure ) : System
address System.Net.IPAddress /// A that contains a local IP address. ///
port int /// An that contains a port number. ///
servicePath string /// A that contains an absolute path. ///
secure bool /// A that indicates providing a secure connection or not. /// (true indicates providing a secure connection.) ///
return System

WebSocketServerBase() protected method

Initializes a new instance of the WebSocketServerBase class with the specified logger.
This constructor initializes a new instance of this class as non self hosted server.
protected WebSocketServerBase ( System.Logger logger ) : System
logger System.Logger /// A that provides the logging functions. ///
return System

WebSocketServerBase() protected method

Initializes a new instance of the WebSocketServerBase class that listens for incoming connection attempts on the specified WebSocket URL.
/// is . /// /// is invalid. ///
protected WebSocketServerBase ( string url ) : System
url string /// A that contains a WebSocket URL. ///
return System