System.Net.ConnectionGroup.Associate C# (CSharp) Method

Associate() private method

private Associate ( Connection connection ) : void
connection Connection
return void
        internal void Associate(Connection connection) {
            lock (m_ConnectionList) {
                m_ConnectionList.Add(connection);
            }
            GlobalLog.Print("ConnectionGroup::Associate() Connection:" + connection.GetHashCode());
        }

Usage Example

Esempio n. 1
0
        public Connection(
            ConnectionGroup   connectionGroup,
            ServicePoint      servicePoint,
            IPAddress         remoteAddress,
            Version           version,
            bool              supportsPipeline ) {

            //
            // add this Connection to the pool in the connection group,
            //  keep a weak reference to it
            //

            m_ConnectionGroup = connectionGroup;
            m_WeakReference = new WeakReference(this);
            m_ConnectionGroup.Associate(m_WeakReference);

            m_Idle = true;
            m_Free = true;
            m_CanPipeline = supportsPipeline;
            m_Server = servicePoint;
            m_Version = version;
            m_ReadBuffer = new byte[m_ReadBufferSize];
            m_CurrentRequestIndex = 0;
            m_ReadState = ReadState.Start;
            m_WaitList = new ArrayList();
            m_WriteList = new ArrayList();
            m_ReadCallbackEvent = new ManualResetEvent(true);

            m_StartConnectionDelegate = new WaitOrTimerCallback(StartConnectionCallback);
            m_AbortDelegate = new HttpAbortDelegate(Abort);

            // for status line parsing
            m_StatusLineInts = new int[MaxStatusInts];
            InitializeParseStatueLine();
        }