nn_close.adoc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. nn_close(3)
  2. ===========
  3. NAME
  4. ----
  5. nn_close - close an SP socket
  6. SYNOPSIS
  7. --------
  8. *#include <nanomsg/nn.h>*
  9. *int nn_close (int 's');*
  10. DESCRIPTION
  11. -----------
  12. Closes the socket 's'. Any buffered inbound messages that were not yet received
  13. by the application will be discarded. The library will try to deliver any
  14. outstanding outbound messages for the time specified by _NN_LINGER_ socket
  15. option. The call will block in the meantime.
  16. RETURN VALUE
  17. ------------
  18. If the function succeeds zero is returned. Otherwise, -1 is
  19. returned and 'errno' is set to to one of the values defined below.
  20. ERRORS
  21. ------
  22. *EBADF*::
  23. The provided socket is invalid.
  24. *EINTR*::
  25. Operation was interrupted by a signal. The socket is not fully closed yet.
  26. Operation can be re-started by calling _nn_close()_ again.
  27. EXAMPLE
  28. -------
  29. ----
  30. int s = nn_socket (AF_SP, NN_PUB);
  31. assert (s >= 0);
  32. int rc = nn_close (s);
  33. assert (rc == 0);
  34. ----
  35. SEE ALSO
  36. --------
  37. <<nn_socket#,nn_socket(3)>>
  38. <<nn_setsockopt#,nn_setsockopt(3)>>
  39. <<nanomsg#,nanomsg(7)>>
  40. AUTHORS
  41. -------
  42. link:mailto:sustrik@250bpm.com[Martin Sustrik]