C# Класс Descent.Messaging.AsyncSockets.AsyncSocketsServer

Implementation of the asynchronous sockets server.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AsyncSocketsServer() публичный Метод

Initializes a new instance of the AsyncSocketsServer class.
public AsyncSocketsServer ( int port ) : System
port int /// Port that the server should use. ///
Результат System

Broadcast() публичный Метод

Broadcast a string to all connected clients.
public Broadcast ( string message ) : void
message string The string to broadcast
Результат void

BroadcastExceptClient() публичный Метод

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.
Результат void

Close() публичный Метод

public Close ( ) : void
Результат void

Start() публичный Метод

Start listening and accepting clients.
public Start ( ) : void
Результат void