Ejemplo n.º 1
0
        /// <summary>
        /// Close the socket
        /// </summary>
        public void Close()
        {
            if (!m_isClosed)
            {
                m_isClosed = true;

                m_socketHandle.CheckDisposed();
                m_socketHandle.Close();
            }
        }
Ejemplo n.º 2
0
        /// <summary>Closes this socket, rendering it unusable. Equivalent to calling <see cref="Dispose()"/>.</summary>
        public void Close()
        {
            if (Interlocked.CompareExchange(ref m_isClosed, 1, 0) != 0)
            {
                return;
            }

            m_socketHandle.CheckDisposed();
            m_socketHandle.Close();
        }
Ejemplo n.º 3
0
        /// <summary>Closes this socket, rendering it unusable. Equivalent to calling <see cref="Dispose"/>.</summary>
        public void Close()
        {
            if (m_isClosed)
            {
                return;
            }

            m_isClosed = true;

            m_socketHandle.CheckDisposed();
            m_socketHandle.Close();
        }
Ejemplo n.º 4
0
        /// <summary>Closes this socket, rendering it unusable. Equivalent to calling <see cref="Dispose()"/>.</summary>
        public void Close()
        {
            // #if NETSTANDARD2_0 || NETSTANDARD2_1 || NET47_OR_GREATER
            // if (m_runtime != null)
            // {
            //     m_runtime.Remove(this);
            //     m_runtime  = null;
            // }
            // #endif

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

            m_socketHandle.CheckDisposed();

            m_socketHandle.Close();
        }
Ejemplo n.º 5
0
        public void Close()
        {
            #if NETSTANDARD2_0 || NETSTANDARD2_1 || 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();
        }
Ejemplo n.º 6
0
 public void Close()
 {
     for (int i = 0; i < clients.Length; i++)
     {
         SocketBase con = clients[i];
         if (con == null)
         {
             continue;
         }
         if (!con.isUsed)
         {
             continue;
         }
         lock (con)
         {
             con.Close();
         }
     }
     tcpListener.Stop();
 }
 public virtual void Close()
 {
     m_socketService.Close();
 }