Esempio n. 1
0
        /// <summary>
        /// Connects/reconnects to the server.
        /// </summary>
        private void Connect()
        {
            client = new TcpClient(host, port);

            NetworkStream stream = client.GetStream();

            reader = new HttpReader(stream, this);
            writer = new HttpWriter(stream, this);

            Application.Logger.Log(Logging.LogLevel.Information, "debug", "connected to " + host + ":" + port);
        }
Esempio n. 2
0
        /// <summary>
        /// Processes the incoming connection.
        /// </summary>
        private void Process()
        {
            // get stream
            NetworkStream stream = client.GetStream();

            // create reader/writer
            this.writer = new HttpWriter(stream, this);
            this.reader = new HttpReader(stream, this);

            // handle requests
            while (client.Connected)
            {
                Handle();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Processes the incoming connection.
        /// </summary>
        private void Process()
        {
            // get stream
            NetworkStream stream = client.GetStream();

            // create reader/writer
            this.writer = new HttpWriter(stream, this);
            this.reader = new HttpReader(stream, this);

            // handle requests
            while (client.Connected) {
                Handle();
            }
        }