C# Class Descent.Messaging.AsyncSockets.AsyncSocketsServer

Implementation of the asynchronous sockets server.
Afficher le fichier Open project: nezbo/Descent

Méthodes publiques

Méthode Description
AsyncSocketsServer ( int port ) : System

Initializes a new instance of the AsyncSocketsServer class.

Broadcast ( string message ) : void

Broadcast a string to all connected clients.

BroadcastExceptClient ( string message, int clientId ) : void

Broadcast a string to all connected clients except one.

Close ( ) : void
Start ( ) : void

Start listening and accepting clients.

Private Methods

Méthode Description
AcceptCallback ( IAsyncResult asyncResult ) : void

Called when a client was connected.

ClientConnectionDisconnected ( ClientInfo clientInfo ) : void

Called when a client disconnects. Removes the client from the collection.

Method Details

AsyncSocketsServer() public méthode

Initializes a new instance of the AsyncSocketsServer class.
public AsyncSocketsServer ( int port ) : System
port int /// Port that the server should use. ///
Résultat System

Broadcast() public méthode

Broadcast a string to all connected clients.
public Broadcast ( string message ) : void
message string The string to broadcast
Résultat void

BroadcastExceptClient() public méthode

Broadcast a string to all connected clients except one.
public BroadcastExceptClient ( string message, int clientId ) : void
message string The string to broadcast
clientId int The client which the server shouldn't send to.
Résultat void

Close() public méthode

public Close ( ) : void
Résultat void

Start() public méthode

Start listening and accepting clients.
public Start ( ) : void
Résultat void