Provides the base TCP server upon which more complex TCP-based servers can be built.
More...
|
|
void | Start () |
| | Start the server.
|
|
void | Stop () |
| | Stop the server.
|
|
virtual void | Dispose () |
| | Disposes the server (stops it if it is running)
|
|
| | TcpServer (int minPort=5000, int maxPort=32000) |
| | Construct the server with a random port within the provided range.
|
| | TcpServer (int port) |
| | Construct the server with the explicitly-provided port.
|
|
void | Init () |
| | Override in derived classes: this initializes the server system.
|
| void | Log (string message, params object[] parameters) |
| | Provides a convenience logging mechanism which outputs via the established LogAction.
|
| IProcessor | CreateProcessorFor (TcpClient client) |
| | Create a processor for a particular TCP client.
|
| virtual int | NextRandomPort () |
| | Guesses the next random port to attempt to bind to.
|
|
| bool | Disposed [get] |
| | Flag: when true, this server has been disposed.
|
|
int | MaxShutDownTime = 1000 [get, set] |
| | Maximum time, in milliseconds, to wait on the listener task when shutting down.
|
|
bool | LogRandomPortDiscovery [get, set] |
| | Whether or not to log random port discovery processes.
|
|
Action< string > | LogAction = Console.WriteLine [get, set] |
| | Action to employ when logging (defaults to logging to the console)
|
|
int | Port [get, protected set] |
| | Port which this server has bound to.
|
|
bool | IsListening [get] |
| | Flag exposing listening state.
|
Provides the base TCP server upon which more complex TCP-based servers can be built.
◆ TcpServer() [1/2]
| PeanutButter.SimpleTcpServer.TcpServer.TcpServer |
( |
int | minPort = 5000, |
|
|
int | maxPort = 32000 ) |
|
protected |
Construct the server with a random port within the provided range.
- Parameters
-
◆ TcpServer() [2/2]
| PeanutButter.SimpleTcpServer.TcpServer.TcpServer |
( |
int | port | ) |
|
|
protected |
Construct the server with the explicitly-provided port.
- Parameters
-
◆ CreateProcessorFor()
| IProcessor PeanutButter.SimpleTcpServer.TcpServer.CreateProcessorFor |
( |
TcpClient | client | ) |
|
|
abstractprotected |
Create a processor for a particular TCP client.
- Parameters
-
- Returns
◆ Log()
| void PeanutButter.SimpleTcpServer.TcpServer.Log |
( |
string | message, |
|
|
params object[] | parameters ) |
|
protected |
Provides a convenience logging mechanism which outputs via the established LogAction.
- Parameters
-
◆ NextRandomPort()
| virtual int PeanutButter.SimpleTcpServer.TcpServer.NextRandomPort |
( |
| ) |
|
|
protectedvirtual |
Guesses the next random port to attempt to bind to.
- Returns
◆ Disposed
| bool PeanutButter.SimpleTcpServer.TcpServer.Disposed |
|
get |
The documentation for this class was generated from the following file:
- source/SimpleServers/PeanutButter.SimpleTcpServer/TcpServer.cs