C# Класс ServerNetworkConnections.TCPConnection

Class that encapsulates a socket into a more convenient unit from which you can write AbstractMessage to and read AbstractMessages from
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Close ( ) : void

Closes the TCPConnection.

Read ( ) : AbstractMessage

Reads an AbstractMessage from the TCPConnection. Will throw an XmlException if an invalid Xml message was received.

TCPConnection ( String hostname, UInt16 port, AbstractMessageParser parser ) : System

Initializes the TCPConnection to the given hostname / port.

TCPConnection ( TcpClient client, AbstractMessageParser parser ) : System

Initializes the TCPConnection with the given TcpClient.

Write ( AbstractMessage msg ) : void

Writes the given AbstractMessage into the TCPConnection.

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

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

Closes the TCPConnection.
public Close ( ) : void
Результат void

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

Reads an AbstractMessage from the TCPConnection. Will throw an XmlException if an invalid Xml message was received.
public Read ( ) : AbstractMessage
Результат AbstractMessage

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

Initializes the TCPConnection to the given hostname / port.
public TCPConnection ( String hostname, UInt16 port, AbstractMessageParser parser ) : System
hostname String A String with the hostname of the server
port System.UInt16 A UInt16 with the port of the server.
parser AbstractMessageParser
Результат System

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

Initializes the TCPConnection with the given TcpClient.
public TCPConnection ( TcpClient client, AbstractMessageParser parser ) : System
client System.Net.Sockets.TcpClient The TcpClient to the server.
parser AbstractMessageParser
Результат System

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

Writes the given AbstractMessage into the TCPConnection.
public Write ( AbstractMessage msg ) : void
msg AbstractMessage
Результат void