Пример #1
0
        /// <summary>
        /// Connects the specified host.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        public void Connect(string host, int port = 6667)
        {
            IrcReply.FormatMessage(string.Format("FIRE UP {0}", host), ConsoleColor.Yellow, true);
            try
            {
                this.host = host;
                this.port = port;

                this.client = new TcpClient( );

                iDent       = new Ident("Zero");
                identWorker = new Thread(iDent.InitServer)
                {
                    Name = "DaQueen", IsBackground = false
                };
                identWorker.Start( );

                killerQueen = new Thread(KillItWithFire)
                {
                    Name = "KillerQueen", IsBackground = false
                };
                killerQueen.Start( );

                this.client.SendBufferSize = 4096;
                this.client.Connect(host, port);
                this.stream = this.client.GetStream( );
                this.reader = new StreamReader(this.stream);
                this.writer = new StreamWriter(this.stream);
                Listen( );
            }
            catch (Exception ex)
            {
                Format(ex.ToString( ), ConsoleColor.Red);
            }
        }
Пример #2
0
        /// <summary>
        /// Connects the specified host.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        internal void Connect(string host, int port = 6667)
        {
            IrcReply.FormatMessage(string.Format("FIRE UP {0}", host), ConsoleColor.Yellow, true);
            try
            {
                dbg.WriteLine("Setting host and port...");
                this.host = host;
                this.port = port;

                Warning("Instantiating a new TcpClient...");
                this.client = new TcpClient( );

                Info("Instantiating a new Ident Thread");
                iDent       = new Ident("Zero");
                identWorker = new Thread(iDent.InitServer)
                {
                    Name = "DaQueen", IsBackground = false
                };
                identWorker.Start( );

                killerQueen = new Thread(KillItWithFire)
                {
                    Name = "KillerQueen", IsBackground = false
                };
                killerQueen.Start( );

                dbg.WriteLine("Setting buffer..");
                this.client.SendBufferSize = 8192;

                Info("Connecting to host, setting streams up and then preparing to PASS...");
                this.client.Connect(host, port);
                dbg.WriteLine(".");
                this.stream = this.client.GetStream( );

                dbg.WriteLine("..");
                this.reader = new StreamReader(this.stream);
                this.writer = new StreamWriter(this.stream);

                dbg.WriteLine("...");
                Info("Sending Credentials for Validation...");

                Listen( );
            }
            catch (Exception ex)
            {
                Format(ex.ToString( ), ConsoleColor.Red);
            }
        }
Пример #3
0
        /// <summary>
        /// Connects the specified host.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        internal void Connect( string host, int port = 6667 )
        {
            IrcReply.FormatMessage ( string.Format ( "FIRE UP {0}", host ), ConsoleColor.Yellow, true );
            try
            {
                dbg.WriteLine ( "Setting host and port..." );
                this.host = host;
                this.port = port;

                Warning ( "Instantiating a new TcpClient..." );
                this.client = new TcpClient ( );

                Info ( "Instantiating a new Ident Thread" );
                iDent = new Ident ( "Zero" );
                identWorker = new Thread ( iDent.InitServer ) { Name = "DaQueen", IsBackground = false };
                identWorker.Start ( );

                killerQueen = new Thread ( KillItWithFire ) { Name = "KillerQueen", IsBackground = false };
                killerQueen.Start ( );

                dbg.WriteLine ( "Setting buffer.." );
                this.client.SendBufferSize = 8192;

                Info ( "Connecting to host, setting streams up and then preparing to PASS..." );
                this.client.Connect ( host, port );
                dbg.WriteLine ( "." );
                this.stream = this.client.GetStream ( );

                dbg.WriteLine ( ".." );
                this.reader = new StreamReader ( this.stream );
                this.writer = new StreamWriter ( this.stream );

                dbg.WriteLine ( "..." );
                Info ( "Sending Credentials for Validation..." );

                Listen ( );
            }
            catch ( Exception ex )
            {
                Format ( ex.ToString ( ), ConsoleColor.Red );
            }
        }
Пример #4
0
        /// <summary>
        /// Connects the specified host.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        public void Connect( string host, int port = 6667 )
        {
            IrcReply.FormatMessage ( string.Format ( "FIRE UP {0}", host ), ConsoleColor.Yellow, true );
            try
            {
                this.host = host;
                this.port = port;

                this.client = new TcpClient ( );

                iDent = new Ident ( "Zero" );
                identWorker = new Thread ( iDent.InitServer ) { Name = "DaQueen", IsBackground = false };
                identWorker.Start ( );

                killerQueen = new Thread ( KillItWithFire ) { Name = "KillerQueen", IsBackground = false };
                killerQueen.Start ( );

                this.client.SendBufferSize = 4096;
                this.client.Connect ( host, port );
                this.stream = this.client.GetStream ( );
                this.reader = new StreamReader ( this.stream );
                this.writer = new StreamWriter ( this.stream );
                Listen ( );
            }
            catch ( Exception ex )
            {
                Format ( ex.ToString ( ), ConsoleColor.Red );
            }
        }