// Add a SocketAsyncEventArg instance to the pool
        //
        //The "item" parameter is the SocketAsyncEventArgs instance
        // to add to the pool
        public void Push(SocketAsyncEventArgsProxy item)
        {
            ExceptionExtension.ArgumentNullExceptionIfNull(item, "item");

            item.Reset();
            _pools.Push(item);
        }
예제 #2
0
        public SocketAsyncEventArgsPool(IEnumerable <SocketAsyncEventArgs> enumerator)
        {
            ExceptionExtension.ArgumentNullExceptionIfNull(enumerator, "enumerator");

            _pools = new ConcurrentStack <SocketAsyncEventArgs>(enumerator);
        }