コード例 #1
0
 public override void ProcessConnection(Socket m_clientSocket)
 {
     /// Get from factory
     HttpPipe[] pipes = httpPipesChainsFactory.GetPipesInChain("BaseChain");
     currentChain = new HttpPipesChain();
     currentChain.AddFirst(pipes);
     currentChain.ChainState.ClientSocket = m_clientSocket;
     currentChain.ChainState.HttpProxlet  = this;
     currentChain.GetFirstPipe().StartReceive();
 }
コード例 #2
0
        public override void Release()
        {
            if (currentChain == null)
            {
                base.Release();
                return;
            }

            HttpPipe pipe  = currentChain.GetFirstPipe();
            HttpPipe pipet = null;

            while (pipe != null)
            {
                pipet = pipe;
                pipe  = currentChain.GetNextPipe(pipe);
                pipet.Close();
            }

            currentChain.ChainState.Clear();

            if (currentChain.ChainState.ServerSocket != null && currentChain.ChainState.ServerSocket.Connected)
            {
                currentChain.ChainState.ServerSocket.Close();
            }

            if (currentChain.ChainState.ClientSocket != null && currentChain.ChainState.ClientSocket.Connected)
            {
                currentChain.ChainState.ClientSocket.Close();
            }

            currentChain.ChainState.ServerSocket = null;
            currentChain.ChainState.ClientSocket = null;
            currentChain.Clear();

            currentChain = null;

            base.Release();
        }