nn_shutdown.adoc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. nn_shutdown(3)
  2. ==============
  3. NAME
  4. ----
  5. nn_shutdown - remove an endpoint from a socket
  6. SYNOPSIS
  7. --------
  8. *#include <nanomsg/nn.h>*
  9. *int nn_shutdown (int 's', int 'how');*
  10. DESCRIPTION
  11. -----------
  12. Removes an endpoint from socket 's'. 'how' parameter specifies the ID of the
  13. endpoint to remove as returned by prior call to <<nn_bind#,nn_bind(3)>> or
  14. <<nn_connect#,nn_connect(3)>>. _nn_shutdown()_ call will return immediately,
  15. however, the library will try to deliver any outstanding outbound messages to
  16. the endpoint for the time specified by _NN_LINGER_ socket option.
  17. RETURN VALUE
  18. ------------
  19. If the function succeeds zero is returned. Otherwise, -1 is
  20. returned and 'errno' is set to to one of the values defined below.
  21. ERRORS
  22. ------
  23. *EBADF*::
  24. The provided socket is invalid.
  25. *EINVAL*::
  26. The 'how' parameter doesn't correspond to an active endpoint.
  27. *EINTR*::
  28. Operation was interrupted by a signal. The endpoint is not fully closed yet.
  29. Operation can be re-started by calling _nn_shutdown()_ again.
  30. *ETERM*::
  31. The library is terminating.
  32. EXAMPLE
  33. -------
  34. ----
  35. s = nn_socket (AF_SP, NN_PUB);
  36. eid = nn_bind (s, "inproc://test");
  37. nn_shutdown (s, eid);
  38. ----
  39. SEE ALSO
  40. --------
  41. <<nn_socket#,nn_socket(3)>>
  42. <<nn_bind#,nn_bind(3)>>
  43. <<nn_connect#,nn_connect(3)>>
  44. <<nanomsg#,nanomsg(7)>>
  45. AUTHORS
  46. -------
  47. link:mailto:sustrik@250bpm.com[Martin Sustrik]