private void Close() { if (m_handle == null) { return; } try { m_handle.Dispose(); m_socket.EventClosed(m_address.ToString(), m_handle); } catch (SocketException ex) { m_socket.EventCloseFailed(m_address.ToString(), ErrorHelper.SocketErrorToErrorCode(ex.SocketErrorCode)); } catch (NetMQException ex) { m_socket.EventCloseFailed(m_address.ToString(), ex.ErrorCode); } m_handle = null; }
public void Init(string network) { m_address = new PgmAddress(network); m_pgmSocket = new PgmSocket(m_options, PgmSocketType.Listener, m_address); m_pgmSocket.Init(); m_handle = m_pgmSocket.Handle; try { m_handle.Bind(m_address.Address); m_pgmSocket.InitOptions(); m_handle.Listen(m_options.Backlog); } catch (SocketException ex) { Close(); throw NetMQException.Create(ex); } m_socket.EventListening(m_address.ToString(), m_handle); }
public void Init([NotNull] string network) { m_address = new PgmAddress(network); m_pgmSocket = new PgmSocket(m_options, PgmSocketType.Listener, m_address); m_pgmSocket.Init(); m_handle = m_pgmSocket.Handle; try { m_handle.Bind(m_address.Address); m_pgmSocket.InitOptions(); m_handle.Listen(m_options.Backlog); } catch (SocketException ex) { Close(); throw NetMQException.Create(ex); } m_socket.EventListening(m_address.ToString(), m_handle); }