Property | Type | Description | |
---|---|---|---|
connLock | Object | ||
fAddress | |||
fConnections | List |
||
fIndex | int | ||
fIsRunning | bool | ||
fPort | int | ||
fSsl | bool | ||
fSslCertificate | string | ||
fTerminated | bool | ||
listener | TcpListener |
Method | Description | |
---|---|---|
CloseAllConnection ( int aCloseCode, string aCloseReason ) : void |
close all server connections
|
|
GetConnection ( int index ) : |
return connection by its position in list
|
|
GetConnectionByIndex ( int index ) : |
return connection by its position Index property
|
|
GetConnectionInstance ( |
Function to create WebSocketServerConnection instance. Function should return null if connection should not be accepted or some non 101 HTTP result code (see below) if application implementation needs to use it's own inplementation of WebSocketServerConnection (based on WebSocketServerConnection class) application should create new WebSocketServer (based on this one) and override this method to return its own instance of connection based on either application logic or passed parameters All parameters, except for aClient and aHttpCode refers to properties in WebSocketConnection, check the documentation of WebSocketConnection Function does not have to set up phis variables to result object properties, it's done automatically by server after object is returned.
|
|
LockConnections ( ) : void |
this function should be used when application needs to travers through connections function locks the connection list for removal from different thread, no connection will be removed until UnlockConnections is called UnlockConnections MUST be called after traversing
|
|
Start ( |
start server
|
|
Stop ( ) : void |
Stop server
|
|
UnlockConnections ( ) : void |
this function should be used when application needs to travers through connections function unlocks the connection list for removal from different thread, function should be called after LockConnections is called
|
|
WebSocketServer ( ) : System |
constructor function
|
Method | Description | |
---|---|---|
AddConnection ( |
basic function to add WebSocket connection to list of connections
|
|
Execute ( ) : void |
thread function this function actually waits for incomming connections and spawns new server threads
|
|
RemoveConnection ( |
||
SafeRemoveConnection ( |
||
httpCode ( int aCode ) : string |
protected AddConnection ( |
||
aClient | incomming connection | |
aStream | Stream | |
return |
public CloseAllConnection ( int aCloseCode, string aCloseReason ) : void | ||
aCloseCode | int | WebSocketCloseCode constant reason |
aCloseReason | string | textual data (max 123 bytes) |
return | void |
public GetConnection ( int index ) : |
||
index | int | position in list |
return |
public GetConnectionByIndex ( int index ) : |
||
index | int | connection's Index ptoperty |
return |
public GetConnectionInstance ( |
||
aClient | TcpClient requesting connection, client MUST NOT be closed by this function | |
aHeaders | Bauglir.Ex.WebSocketHeaders | |
aHost | string | |
aPort | string | |
aResourceName | string | |
aOrigin | string | If "-" passed, no origin was passed by client |
aCookie | string | If "-" passed, no cookies was passed by client |
aVersion | string | |
aProtocol | string | In value is list of protocol requested by client ("-" if non requested). Out values should be list of protocol supported by server based on client request, if "-" is returned, no protocol will be negotitated |
aExtension | string | In value is list of extensions requested by client ("-" if non requested). Out values should be list of extensions supported by server based on client request, if "-" is returned, no extensions will be negotitated |
aHttpCode | int | HTTP result code to return, if other than 101 is returned, connection will be automatically closed. 101 is default value |
return |
protected RemoveConnection ( |
||
aConnection | ||
return | void |
protected SafeRemoveConnection ( |
||
aConnection | ||
return | void |
public Start ( |
||
aAddress | ||
aPort | int | |
return | bool |