예제 #1
0
        /// <summary>Closes this socket, rendering it unusable. Equivalent to calling <see cref="Dispose()"/>.</summary>
        public void Close()
        {
            #if NETSTANDARD2_0 || NET47
            if (m_runtime != null)
            {
                m_runtime.Remove(this);
                m_runtime = null;
            }
            #endif

            if (Interlocked.CompareExchange(ref m_isClosed, 1, 0) != 0)
            {
                return;
            }

            m_socketHandle.CheckDisposed();

            m_socketHandle.Close();
        }
예제 #2
0
 internal void DetachFromRuntime()
 {
     m_runtime = null;
 }