Sharpcraft.Networking.Protocol.Protocol C# (CSharp) Method

Protocol() public method

Initialize a new instance of Protocol.
public Protocol ( string server, int port ) : System
server string Server address to connect to.
port int Server port.
return System
        public Protocol(string server, int port)
        {
            _log = LogManager.GetLogger(this);
            _log.Debug("Connecting to server.");
            _tcpClient = new TcpClient();
            _tcpClient.Connect(server, port);
            _log.Debug("Getting stream.");
            _stream = _tcpClient.GetStream();
            _log.Debug("Initializing tools.");
            _tools = new NetworkTools(_stream);
        }