|
Alchemy Websockets
An extremely efficient C# WebSocket server.
|
The Main WebSocket Server. More...
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. | |
The Main WebSocket Server.
Definition at line 17 of file WebSocketServer.cs.
| Alchemy.WebSocketServer.WebSocketServer | ( | int | listenPort = 0, |
| IPAddress | listenAddress = null |
||
| ) |
Initializes a new instance of the WebSocketServer class.
| listenPort | The listen port. |
| listenAddress | The listen ip. |
Definition at line 64 of file WebSocketServer.cs.
| override void Alchemy.WebSocketServer.OnRunClient | ( | TcpClient | connection | ) | [protected, virtual] |
Fires when a client connects.
| connection | The 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.
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().
Definition at line 31 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.OnRunClient().
Definition at line 32 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.OnRunClient().
Definition at line 33 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.OnRunClient().
Definition at line 34 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.OnRunClient().
| bool Alchemy.WebSocketServer.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.
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") |
Definition at line 47 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.OnRunClient(), Alchemy.WebSocketServer.Start(), and Alchemy.WebSocketServer.Stop().
| 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().
string Alchemy.WebSocketServer.DestinationHost [get, set] |
Gets or sets the destination host.
The destination host.
Definition at line 93 of file WebSocketServer.cs.
string Alchemy.WebSocketServer.LogConfigFile [set] |
Sets the log config file name.
The log config file name.
Definition at line 120 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.WebSocketServer().
string Alchemy.WebSocketServer.LoggerName [set] |
Sets the name of the logger.
The name of the logger.
Definition at line 109 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.WebSocketServer().
string Alchemy.WebSocketServer.OriginHost [get, set] |
Gets or sets the origin host.
The origin host.
Definition at line 77 of file WebSocketServer.cs.
Referenced by Alchemy.WebSocketServer.Start().