Alchemy Websockets
An extremely efficient C# WebSocket server.
Alchemy.WebSocketServer Class Reference

The Main WebSocket Server. More...

Inheritance diagram for Alchemy.WebSocketServer:
Alchemy.TcpServer

List of all members.

Public Member Functions

 WebSocketServer (int listenPort=0, IPAddress listenAddress=null)
 Initializes a new instance of the WebSocketServer class.
override void Start ()
 Starts this instance.
override void Stop ()
 Stops this instance.

Public Attributes

OnEventDelegate DefaultOnConnect = x => { }
 These are the default OnEvent delegates for the server. By default, all new UserContexts will use these events. It is up to you whether you want to replace them at runtime or even manually set the events differently per connection in OnReceive.
OnEventDelegate DefaultOnConnected = x => { }
OnEventDelegate DefaultOnDisconnect = x => { }
OnEventDelegate DefaultOnReceive = x => { }
OnEventDelegate DefaultOnSend = x => { }
bool FlashAccessPolicyEnabled = true
 Enables or disables the Flash Access Policy Server(APServer). This is used when you would like your app to only listen on a single port rather than 2. Warning, any flash socket connections will have an added delay on connection due to the client looking to port 843 first for the connection restrictions.
ILog Log = LogManager.GetLogger("Alchemy.Log")
TimeSpan TimeOut = TimeSpan.FromMinutes(1)
 Configuration for the above heartbeat setup. TimeOut : How long until a connection drops when it doesn't receive anything. MaxPingsInSequence : A multiple of TimeOut for how long a connection can remain idle(only pings received) before we kill it.

Protected Member Functions

override void OnRunClient (TcpClient connection)
 Fires when a client connects.

Properties

string OriginHost [get, set]
 Gets or sets the origin host.
string DestinationHost [get, set]
 Gets or sets the destination host.
string LoggerName [set]
 Sets the name of the logger.
string LogConfigFile [set]
 Sets the log config file name.

Detailed Description

The Main WebSocket Server.

Definition at line 17 of file WebSocketServer.cs.


Constructor & Destructor Documentation

Alchemy.WebSocketServer.WebSocketServer ( int  listenPort = 0,
IPAddress  listenAddress = null 
)

Initializes a new instance of the WebSocketServer class.

Parameters:
listenPortThe listen port.
listenAddressThe listen ip.

Definition at line 64 of file WebSocketServer.cs.


Member Function Documentation

override void Alchemy.WebSocketServer.OnRunClient ( TcpClient  connection) [protected, virtual]

Fires when a client connects.

Parameters:
connectionThe TCP Connection.

Implements Alchemy.TcpServer.

Definition at line 177 of file WebSocketServer.cs.

override void Alchemy.WebSocketServer.Start ( ) [virtual]

Starts this instance.

Reimplemented from Alchemy.TcpServer.

Definition at line 127 of file WebSocketServer.cs.

override void Alchemy.WebSocketServer.Stop ( ) [virtual]

Stops this instance.

Reimplemented from Alchemy.TcpServer.

Definition at line 154 of file WebSocketServer.cs.


Member Data Documentation

These are the default OnEvent delegates for the server. By default, all new UserContexts will use these events. It is up to you whether you want to replace them at runtime or even manually set the events differently per connection in OnReceive.

Definition at line 29 of file WebSocketServer.cs.

Referenced by Alchemy.WebSocketServer.OnRunClient().

Enables or disables the Flash Access Policy Server(APServer). This is used when you would like your app to only listen on a single port rather than 2. Warning, any flash socket connections will have an added delay on connection due to the client looking to port 843 first for the connection restrictions.

Definition at line 41 of file WebSocketServer.cs.

Referenced by Alchemy.WebSocketServer.Start(), and Alchemy.WebSocketServer.Stop().

ILog Alchemy.WebSocketServer.Log = LogManager.GetLogger("Alchemy.Log")
TimeSpan Alchemy.WebSocketServer.TimeOut = TimeSpan.FromMinutes(1)

Configuration for the above heartbeat setup. TimeOut : How long until a connection drops when it doesn't receive anything. MaxPingsInSequence : A multiple of TimeOut for how long a connection can remain idle(only pings received) before we kill it.

Definition at line 54 of file WebSocketServer.cs.

Referenced by Alchemy.WebSocketServer.OnRunClient().


Property Documentation

Gets or sets the destination host.

The destination host.

Definition at line 93 of file WebSocketServer.cs.

Sets the log config file name.

The log config file name.

Definition at line 120 of file WebSocketServer.cs.

Referenced by Alchemy.WebSocketServer.WebSocketServer().

Sets the name of the logger.

The name of the logger.

Definition at line 109 of file WebSocketServer.cs.

Referenced by Alchemy.WebSocketServer.WebSocketServer().

Gets or sets the origin host.

The origin host.

Definition at line 77 of file WebSocketServer.cs.

Referenced by Alchemy.WebSocketServer.Start().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties