3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Server::TcpServer Class Reference

Implements a 3rd Eye Scene server over TCP/IP. More...

Inheritance diagram for Tes::Server::TcpServer:
Tes::Server::IServer

List of all members.

Public Member Functions

 TcpServer (ServerSettings settings)
 Create a new TcpServer with the given settings .
 TcpServer (ServerSettings settings, ServerInfoMessage serverInfo)
 Create a new TcpServer with the given settings and serverInfo .
int Send (PacketBuffer packet)
 Send a packet to all clients.
int Create (Shape shape)
 Send a shape create message to connected clients.
int Destroy (Shape shape)
 Send a shape destroy message to connected clients.
int Update (Shape shape)
 Send a shape update message to connected clients.
int UpdateTransfers (int byteLimit)
 Update pending resource transfers on all clients.
int UpdateFrame (float dt, bool flush=true)
 Send a frame update message to each client.
IConnection Connection (int index)
 Request direct access to one of the connections.
void UpdateConnections (IList< IConnection > connections, NewConnectionCallback callback=null)
 Update the list of current connections.

Properties

ServerSettings Settings [get, set]
 The settings for this server.
IConnectionMonitor ConnectionMonitor [get, set]
 The connection monitor used to manage connections.
ServerInfoMessage ServerInfo [get, set]
 The server info message sent to each new connection identifying this server's world configuration.
int ConnectionCount [get]
 The number of current connections.
IEnumerable< IConnectionConnections [get]
 Enumerates the current connections.

Detailed Description

Implements a 3rd Eye Scene server over TCP/IP.


Constructor & Destructor Documentation

Tes::Server::TcpServer::TcpServer ( ServerSettings  settings) [inline]

Create a new TcpServer with the given settings .

Parameters:
settingsThe settings to instantiate with.
Tes::Server::TcpServer::TcpServer ( ServerSettings  settings,
ServerInfoMessage  serverInfo 
) [inline]

Create a new TcpServer with the given settings and serverInfo .

Parameters:
settingsThe settings to instantiate with.
serverInfoThe ServerInfoMessage sent to new clients.

Member Function Documentation

IConnection Tes::Server::TcpServer::Connection ( int  index) [inline]

Request direct access to one of the connections.

Parameters:
indexThe connection index [0, ConnectionCount)
Returns:
The connection, or null if index is out of range.

Implements Tes::Server::IServer.

int Tes::Server::TcpServer::Create ( Shape  shape) [inline]

Send a shape create message to connected clients.

Parameters:
shapeThe shape to create.
Returns:
The number of bytes sent. Negative if a client failed to send.

Implements Tes::Server::IServer.

int Tes::Server::TcpServer::Destroy ( Shape  shape) [inline]

Send a shape destroy message to connected clients.

Parameters:
shapeThe shape to destroy.
Returns:
The number of bytes sent. Negative if a client failed to send.

Implements Tes::Server::IServer.

int Tes::Server::TcpServer::Send ( PacketBuffer  packet) [inline]

Send a packet to all clients.

Parameters:
packetThe packet to send.
Returns:
The number of bytes sent. Negative on any failure.

The packet must be finalised before this call.

Implements Tes::Server::IServer.

int Tes::Server::TcpServer::Update ( Shape  shape) [inline]

Send a shape update message to connected clients.

Parameters:
shapeThe shape to update.
Returns:
The number of bytes sent. Negative if a client failed to send.

Implements Tes::Server::IServer.

void Tes::Server::TcpServer::UpdateConnections ( IList< IConnection connections,
NewConnectionCallback  callback = null 
) [inline]

Update the list of current connections.

Parameters:
connectionsThe list of active connections.
callbackA callback to invoke for each new connection in connections . May be null

The internal connections list is updated to match connections .

This method is called by the ConnectionMonitor and should not be called directly.

Implements Tes::Server::IServer.

int Tes::Server::TcpServer::UpdateFrame ( float  dt,
bool  flush = true 
) [inline]

Send a frame update message to each client.

Parameters:
dtThe time elapsed for this frame (seconds).
flushFlush transient shapes this frame?
Returns:
The number of bytes sent. Negative if a client failed to send.

Implements Tes::Server::IServer.

int Tes::Server::TcpServer::UpdateTransfers ( int  byteLimit) [inline]

Update pending resource transfers on all clients.

Parameters:
byteLimitLimits the number of byte to send per client. Zero for no limit.
Returns:
The number of bytes sent. Negative if a client failed to send.

Implements Tes::Server::IServer.


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