C# Класс Rover.TCPServer

Показать файл Открыть проект

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

Метод Описание
GetClientId ( TcpClient client ) : int

Get the client ID of the specified client.

GetConnectedClients ( ) : ArrayList

Get all connected clients to the server

PrintAllClientInfo ( ) : void

Print all client information

PrintClientInfo ( TcpClient client ) : void

Print the client information

SendData ( object client, byte message, int size ) : void

Send data to the specified client.

TCPServer ( int Port, TransmittedCBType aTransmittedCBHandler, ReceivedCBType aReceivedCBHandler, ClientFoundCBType aClientFoundCBHandler, ClientLostCBType aClientLostCBHandler ) : System

TCP server constuctor, this instanciate the server on the specified port.

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

Метод Описание
ReceiveThreadHandler ( object client ) : void

Handles the data received from a client.

ServerListeningThreadHandler ( ) : void

Internal Listen thread, each time a server is created a listening thread is also created.

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

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

Get the client ID of the specified client.
public GetClientId ( TcpClient client ) : int
client System.Net.Sockets.TcpClient
Результат int

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

Get all connected clients to the server
public GetConnectedClients ( ) : ArrayList
Результат System.Collections.ArrayList

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

Print all client information
public PrintAllClientInfo ( ) : void
Результат void

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

Print the client information
public PrintClientInfo ( TcpClient client ) : void
client System.Net.Sockets.TcpClient
Результат void

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

Send data to the specified client.
public SendData ( object client, byte message, int size ) : void
client object
message byte
size int
Результат void

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

TCP server constuctor, this instanciate the server on the specified port.
public TCPServer ( int Port, TransmittedCBType aTransmittedCBHandler, ReceivedCBType aReceivedCBHandler, ClientFoundCBType aClientFoundCBHandler, ClientLostCBType aClientLostCBHandler ) : System
Port int
aTransmittedCBHandler TransmittedCBType
aReceivedCBHandler ReceivedCBType
aClientFoundCBHandler ClientFoundCBType
aClientLostCBHandler ClientLostCBType
Результат System