Example #1
0
        /// <summary>
        /// Releases the resources used by this class.
        /// </summary>
        /// <param name="disposing">
        /// True to release both managed and unmanaged resources; false to release only unmanaged resources.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (!isDisposed)
            {
                if (disposing)
                {
                    if (!(listenSocket is null))
                    {
                        listenSocket.Dispose();
                    }
                    listenSocket = null;

                    if (!(maxConnectionEnforcer is null))
                    {
                        maxConnectionEnforcer.Dispose();
                    }
                    maxConnectionEnforcer = null;

                    if (!(acceptPool is null))
                    {
                        acceptPool.Dispose();
                    }
                    acceptPool = null;

                    peers = null;
                }

                isDisposed = true;
            }
        }
        /// <summary>
        /// Releases the resources used by this instance.
        /// </summary>
        /// <param name="disposing">
        /// True to release both managed and unmanaged resources; false to release only unmanaged resources.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (!isDisposed)
            {
                if (disposing)
                {
                    if (!(sendReceivePool is null))
                    {
                        sendReceivePool.Dispose();
                    }
                    sendReceivePool = null;
                }

                isDisposed = true;
            }
        }
Example #3
0
        /// <summary>
        /// Releases the resources used by this instance.
        /// </summary>
        /// <param name="disposing">
        /// True to release both managed and unmanaged resources; false to release only unmanaged resources.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (!isDisposed)
            {
                if (disposing)
                {
                    if (!(connectPool is null))
                    {
                        connectPool.Dispose();
                    }
                    connectPool = null;

                    peers = null;
                }

                isDisposed = true;
            }
        }
Example #4
0
        /// <summary>
        /// Releases the resources used by this instance.
        /// </summary>
        /// <param name="disposing">
        /// True to release both managed and unmanaged resources; false to release only unmanaged resources.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (!isDisposed)
            {
                if (disposing)
                {
                    if (!(maxConnectionEnforcer is null))
                    {
                        maxConnectionEnforcer.Dispose();
                    }
                    maxConnectionEnforcer = null;

                    if (!(connectPool is null))
                    {
                        connectPool.Dispose();
                    }
                    connectPool = null;

                    peers = null;
                }

                isDisposed = true;
            }
        }