ServerNetworkConnections.TCPConnection.TCPConnection C# (CSharp) Method

TCPConnection() public method

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
return System
        public TCPConnection(String hostname, UInt16 port, AbstractMessageParser parser)
        {
            this.client = new TcpClient(hostname, port);
            this.stream = client.GetStream();
            this.writer = new StreamWriter(stream);
            this.reader = new StreamReader(stream);
            this.parser = parser;
            this.localEndPoint = client.Client.LocalEndPoint;
            this.remoteEndPoint = client.Client.RemoteEndPoint;
        }

Same methods

TCPConnection::TCPConnection ( TcpClient client, AbstractMessageParser parser ) : System