C# Class ServerNetworkConnections.TCPConnection

Class that encapsulates a socket into a more convenient unit from which you can write AbstractMessage to and read AbstractMessages from
Afficher le fichier Open project: bakacaptain/istalkapp Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

Close() public méthode

Closes the TCPConnection.
public Close ( ) : void
Résultat void

Read() public méthode

Reads an AbstractMessage from the TCPConnection. Will throw an XmlException if an invalid Xml message was received.
public Read ( ) : AbstractMessage
Résultat AbstractMessage

TCPConnection() public méthode

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
Résultat System

TCPConnection() public méthode

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
Résultat System

Write() public méthode

Writes the given AbstractMessage into the TCPConnection.
public Write ( AbstractMessage msg ) : void
msg AbstractMessage
Résultat void