C# Class Descent.Messaging.Connection.ServerConnection

A TCP server connection.
Inheritance: Connection
Mostra file Open project: nezbo/Descent

Private Properties

Property Type Description
AcceptProcedure bool
ClientConnected bool
MessageReceived void

Public Methods

Method Description
Close ( ) : void
SendString ( string message ) : void

Sends a string through the server. Will send to all clients except the sender of the message.

ServerConnection ( int port ) : System
Start ( ) : void

Start the server. Will listen on port for new clients.

Private Methods

Method Description
AcceptProcedure ( ClientInfo newClient ) : bool

Decides if a new client can join the server.

ClientConnected ( ClientInfo newClient ) : bool

Called when a client has connected.

MessageReceived ( ClientInfo fromClient, string message ) : void

Called when a message was received.

Method Details

Close() public method

public Close ( ) : void
return void

SendString() public method

Sends a string through the server. Will send to all clients except the sender of the message.
public SendString ( string message ) : void
message string The string to send.
return void

ServerConnection() public method

public ServerConnection ( int port ) : System
port int
return System

Start() public method

Start the server. Will listen on port for new clients.
public Start ( ) : void
return void