System.Net.PooledStream.Activate C# (CSharp) Метод

Activate() приватный Метод

private Activate ( object owningObject, GeneralAsyncDelegate asyncCallback ) : bool
owningObject object
asyncCallback GeneralAsyncDelegate
Результат bool
        internal bool Activate(object owningObject, GeneralAsyncDelegate asyncCallback)
        {
            return Activate(owningObject, asyncCallback != null, Timeout.Infinite, asyncCallback);
        }

Same methods

PooledStream::Activate ( object owningObject, bool async, int timeout, GeneralAsyncDelegate asyncCallback ) : bool

Usage Example

Пример #1
0
        internal PooledStream GetConnection(object owningObject, GeneralAsyncDelegate asyncCallback, int creationTimeout)
        {
            int          num;
            PooledStream pooledStream = null;
            bool         continueLoop = true;
            bool         flag2        = asyncCallback != null;

            if (this.m_State != State.Running)
            {
                throw new InternalException();
            }
            Interlocked.Increment(ref this.m_WaitCount);
            WaitHandle[] waitHandles = this.m_WaitHandles;
            if (!flag2)
            {
                while ((pooledStream == null) && continueLoop)
                {
                    num          = WaitHandle.WaitAny(waitHandles, creationTimeout, false);
                    pooledStream = this.Get(owningObject, num, ref continueLoop, ref waitHandles);
                }
            }
            else
            {
                num = WaitHandle.WaitAny(waitHandles, 0, false);
                if (num != 0x102)
                {
                    pooledStream = this.Get(owningObject, num, ref continueLoop, ref waitHandles);
                }
                if (pooledStream == null)
                {
                    AsyncConnectionPoolRequest asyncRequest = new AsyncConnectionPoolRequest(this, owningObject, asyncCallback, creationTimeout);
                    this.QueueRequest(asyncRequest);
                }
            }
            if (pooledStream != null)
            {
                if (!pooledStream.IsInitalizing)
                {
                    asyncCallback = null;
                }
                try
                {
                    if (!pooledStream.Activate(owningObject, asyncCallback))
                    {
                        pooledStream = null;
                    }
                    return(pooledStream);
                }
                catch
                {
                    this.PutConnection(pooledStream, owningObject, creationTimeout, false);
                    throw;
                }
            }
            if (!flag2)
            {
                throw new InternalException();
            }
            return(pooledStream);
        }
All Usage Examples Of System.Net.PooledStream::Activate