Beispiel #1
0
 //  Close the connecting socket.
 private void Close()
 {
     Debug.Assert(m_s != null);
     try
     {
         m_s.Close();
         m_socket.EventClosed(m_endpoint, m_s);
         m_s = null;
     }
     catch (SocketException ex)
     {
         m_socket.EventCloseFailed(m_endpoint, ErrorHelper.SocketErrorToErrorCode(ex.SocketErrorCode));
     }
 }
Beispiel #2
0
        //  Close the listening socket.
        private void Close()
        {
            if (m_handle == null)
            {
                return;
            }

            try
            {
                m_handle.Close();
                m_socket.EventClosed(m_endpoint, m_handle);
            }
            catch (SocketException ex)
            {
                m_socket.EventCloseFailed(m_endpoint, ErrorHelper.SocketErrorToErrorCode(ex.SocketErrorCode));
            }
            catch (NetMQException ex)
            {
                m_socket.EventCloseFailed(m_endpoint, ex.ErrorCode);
            }
            m_handle = null;
        }
Beispiel #3
0
        private void Close()
        {
            if (m_handle == null)
            {
                return;
            }

            try
            {
                m_handle.Close();
                m_socket.EventClosed(m_address.ToString(), m_handle);
            }
            catch (SocketException ex)
            {
                m_socket.EventCloseFailed(m_address.ToString(), ErrorHelper.SocketErrorToErrorCode(ex.SocketErrorCode));
            }
            catch (NetMQException ex)
            {
                //ZError.exc (e);
                m_socket.EventCloseFailed(m_address.ToString(), ex.ErrorCode);
            }
            m_handle = null;
        }