System.Net.ConnectionPool.GetFromPool C# (CSharp) Method

GetFromPool() private method

Retrieves a pooled stream from the pool proper this work by first attemting to find something in the pool on the New stack and then trying the Old stack if something is not there availble

private GetFromPool ( object owningObject ) : PooledStream
owningObject object
return PooledStream
        private PooledStream GetFromPool(object owningObject) {
            PooledStream res = null;
            GlobalLog.Enter("ConnectionPool#" + ValidationHelper.HashString(this) + "::GetFromPool");
            res = (PooledStream) m_StackNew.Pop();
            if (null == res) {
                res = (PooledStream) m_StackOld.Pop();
            }

            // Shouldn't be null, we could assert here.
            GlobalLog.Assert(res != null, "GetFromPool called with nothing in the pool!");

            if (null != res) {
                res.PostPop(owningObject);
                GlobalLog.Print("GetFromGeneralPool pooledStream#"+ValidationHelper.HashString(res));
            }

            GlobalLog.Leave("ConnectionPool#" + ValidationHelper.HashString(this) + "::GetFromPool",ValidationHelper.HashString(res));
            return(res);
        }