Пример #1
0
        public ChatClient(IRCConfig config)
        {
            this.config = config;
            try
            {
                IRCConnection = new TcpClient(config.server, config.port);
            }
            catch
            {
                Debug.WriteLine("Connection Error");
            }

            try
            {
                ns = IRCConnection.GetStream();
                sr = new StreamReader(ns);
                sw = new StreamWriter(ns);

                sendData("PASS", config.pass);
                sendData("NICK", config.nick);
            }
            catch
            {
                Debug.WriteLine("Communication error");
            }
        }
Пример #2
0
        private TcpClient CreateConnection()
        {
            var connection = new TcpClient(serverAddress, serverPort);

            return connection;
        }