nn_inproc.adoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. nn_inproc(7)
  2. ============
  3. NAME
  4. ----
  5. nn_inproc - in-process transport mechanism
  6. SYNOPSIS
  7. --------
  8. *#include <nanomsg/nn.h>*
  9. *#include <nanomsg/inproc.h>*
  10. DESCRIPTION
  11. -----------
  12. In-process transport allows to send messages between threads or modules inside a
  13. process. In-process address is an arbitrary case-sensitive string preceded by
  14. 'inproc://' protocol specifier. All in-process addresses are visible from any
  15. module within the process. They are not visible from outside of the process.
  16. The nature of in-process transport makes it easy to pass pointers between
  17. threads instead of actual data. This is, however, considered a bad application
  18. design and violates the scalable share-nothing architecture. If you do pass
  19. pointers among threads, synchronising thread access to shared data becomes
  20. your responsibility. Such design also prevents moving the thread into different
  21. process or machine once the need arises. As a rule of the thumb, don't pass
  22. pointers among threads unless you know what you are doing.
  23. The overall buffer size for an inproc connection is determined by NN_RCVBUF
  24. socket option on the receiving end of the connection. NN_SNDBUF socket option
  25. is ignored. In addition to the buffer, one message of arbitrary size will fit
  26. into the buffer. That way, even messages larger than the buffer can be
  27. transfered via inproc connection.
  28. EXAMPLE
  29. -------
  30. ----
  31. nn_bind (s1, "inproc://test");
  32. nn_connect (s2, "inproc://test);
  33. ----
  34. SEE ALSO
  35. --------
  36. <<nn_ipc#,nn_ipc(7)>>
  37. <<nn_tcp#,nn_tcp(7)>>
  38. <<nn_bind#,nn_bind(3)>>
  39. <<nn_connect#,nn_connect(3)>>
  40. <<nanomsg#,nanomsg(7)>>
  41. AUTHORS
  42. -------
  43. link:mailto:sustrik@250bpm.com[Martin Sustrik]