Ejemplo n.º 1
0
        private void Close()
        {
            if (m_handle == null)
            {
                return;
            }

            Assumes.NotNull(m_address);

            try
            {
                m_handle.Dispose();
                m_socket.EventClosed(m_address.ToString(), m_handle);
            }
            catch (SocketException ex)
            {
                m_socket.EventCloseFailed(m_address.ToString(), ex.SocketErrorCode.ToErrorCode());
            }
            catch (NetMQException ex)
            {
                m_socket.EventCloseFailed(m_address.ToString(), ex.ErrorCode);
            }

            m_handle = null;
        }
Ejemplo n.º 2
0
        //  Close the listening socket.
        private void Close()
        {
            if (m_handle == null)
            {
                return;
            }

            try
            {
                m_handle.Dispose();
                m_socket.EventClosed(m_endpoint, m_handle);
            }
            catch (SocketException ex)
            {
                m_socket.EventCloseFailed(m_endpoint, ErrorHelper.SocketErrorToErrorCode(ex.SocketErrorCode));
            }

            if (m_acceptedSocket != null)
            {
                try
                {
                    m_acceptedSocket.Dispose();
                }
                catch (SocketException)
                {
                }
            }

            m_acceptedSocket = null;
            m_handle         = null;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Close the listening socket.
        /// </summary>
        private void Close()
        {
            if (m_handle == null)
            {
                return;
            }

            //Assumes.NotNull(m_endpoint);

            try
            {
                m_handle.Dispose();
                if (m_endpoint != null)
                {
                    m_socket.EventClosed(m_endpoint, m_handle);
                }
            }
            catch (SocketException ex)
            {
                if (m_endpoint != null)
                {
                    m_socket.EventCloseFailed(m_endpoint, ex.SocketErrorCode.ToErrorCode());
                }
            }

            m_handle = null;
        }
Ejemplo n.º 4
0
 //  Close the connecting socket.
 private void Close()
 {
     Debug.Assert(m_s != null);
     try
     {
         m_s.Dispose();
         m_socket.EventClosed(m_endpoint, m_s);
         m_s = null;
     }
     catch (SocketException ex)
     {
         m_socket.EventCloseFailed(m_endpoint, ErrorHelper.SocketErrorToErrorCode(ex.SocketErrorCode));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Close the connecting socket.
 /// </summary>
 private void Close()
 {
     Assumes.NotNull(m_s);
     try
     {
         m_s.Dispose();
         m_socket.EventClosed(m_endpoint, m_s);
         m_s = null;
     }
     catch (SocketException ex)
     {
         m_socket.EventCloseFailed(m_endpoint, ex.SocketErrorCode.ToErrorCode());
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Close the listening socket.
        /// </summary>
        private void Close()
        {
            if (m_handle == null)
            {
                return;
            }

            try
            {
                m_handle.Dispose();
                m_socket.EventClosed(m_endpoint, m_handle);
            }
            catch (SocketException ex)
            {
                m_socket.EventCloseFailed(m_endpoint, ex.SocketErrorCode.ToErrorCode());
            }

            m_handle = null;
        }