Close() public method

public Close ( ) : void
return void
Exemplo n.º 1
0
 public void FreeContext()
 {
     if (_httpClientContext != null)
     {
         _httpClientContext.Close();
     }
 }
Exemplo n.º 2
0
        public void Dispose()
        {
            if (_initialMsgTimeout > 0)
            {
                _receiveDone.Set();
                _initialMsgTimeout = 0;
            }
            if (_networkContext != null && _networkContext.Stream != null)
            {
                if (_networkContext.Stream.CanWrite)
                {
                    _networkContext.Stream.Flush();
                }
                _networkContext.Stream.Close();
                _networkContext.Stream.Dispose();
                _networkContext.Stream = null;
            }

            if (_request != null && _request.InputStream != null)
            {
                _request.InputStream.Close();
                _request.InputStream.Dispose();
                _request = null;
            }

            if (_clientContext != null)
            {
                _clientContext.Close();
                _clientContext = null;
            }
        }