3rd Eye Scene C#
3rd Eye Scene C# documentation
|
Classes | |
class | ConnectionMonitor |
A TCP/IP based implementation of IConnectionMonitor. More... | |
interface | IConnectionMonitor |
interface | IServer |
Defines the interface for a 3rd Eye Scene server. More... | |
struct | ServerSettings |
Defines the initialisation settings for IServer. More... | |
class | TcpConnection |
A client connection over TCP/IP. More... | |
class | TcpServer |
Implements a 3rd Eye Scene server over TCP/IP. More... | |
Enumerations | |
enum | ConnectionMonitorMode { None, Synchronous, Asynchronous } |
Defines the operation mode for a connection monitor. More... | |
enum | ServerFlag { Collate = (1 << 1), Compress = (1 << 2) } |
Defines server option flags. More... | |
Functions | |
server.ConnectionMonitor. | Start (ConnectionMonitorMode.Synchronous) |
Defines a utility interface for monitoring new connections for a IServer. | |
for (;;) | |
server.ConnectionMonitor. | Stop () |
server.ConnectionMonitor. | Join () |
delegate void | NewConnectionCallback (IServer server, IConnection connection) |
Delegate used as a callback when a new connection is added to the server . | |
Variables | |
</code ></example >< example > Asynchronous Usage< code lang="C#"> float | dt = 0 |
IServer | server |
Defines the operation mode for a connection monitor.
None |
Inactive. |
Synchronous |
IConnectionMonitor to be updated from the main thread. |
Asynchronous |
IConnectionMonitor to be updated in a background thread managed by itself. |
delegate void Tes::Server::NewConnectionCallback | ( | IServer | server, |
IConnection | connection | ||
) |
Delegate used as a callback when a new connection is added to the server .
Provided as an argument to IServer.UpdateConnections(IList{IConnection}, NewConnectionCallback).
server | The server to which the connection belongs. |
connection | The new connection. |
server ConnectionMonitor Tes::Server::Start | ( | ConnectionMonitorMode. | Synchronous | ) |
Defines a utility interface for monitoring new connections for a IServer.
The monitor manages listening for new connections and expiring old ones. Doing so can be time consuming, so the monitor supports running its own monitor thread. It also supports synchronous operation in case connection monitoring is unnecessary, or unable to be pushed off thread.
Asynchronous mode is activated by calling Start(ConnectionMonitorMode) and stopped with Stop()Calls to Join() will block until the monitor thread has completed, but should only be called after stop()
has been called. The CommitConnections(NewConnectionCallback) method must still be called by the main thread (synchronously) to control when connections are activated and deactivated.
Synchronous mode is supported by calling MonitorConnections() to accept new connections. This must be followed by a call to CommitConnections(NewConnectionCallback) to commit the changes to the owning IServer.
Synchronous usage.
float dt = 0; IServer server = /* Server.Create()