Ejemplo n.º 1
0
        public IRCClient(string host, short port, string user, string pass, string channel)
        {
            _socketReady = false;
            _host        = host;
            _port        = port;
            _user        = user.ToLower();

            if (!pass.StartsWith("oauth:", StringComparison.InvariantCultureIgnoreCase))
            {
                _pass = "******" + pass;
            }
            else
            {
                _pass = pass;
            }

            _channel       = channel.ToLower();
            _messageQueue  = new Queue <string>();
            _buffer        = new byte[8192];
            _parser        = new IRCParser();
            _messageThread = new Thread(MessageThread);
            _messageThread.Start();
            _pingThread = new Thread(PingThread);
            _pingThread.Start();
        }