Author Topic: a sample for build p2p network based nanomsg  (Read 2008 times)

0 Members and 1 Guest are viewing this topic.

Offline luckybit

  • Hero Member
  • *****
  • Posts: 2921
    • View Profile
  • BitShares: Luckybit
nanomsg is a real zero-copy msg server
Quote
Zero-Copy

While ZeroMQ offers a "zero-copy" API, it's not true zero-copy. Rather it's "zero-copy till the message gets to the kernel boundary". From that point on data is copied as with standard TCP. nanomsg, on the other hand, aims at supporting true zero-copy mechanisms such as RDMA (CPU bypass, direct memory-to-memory copying) and shmem (transfer of data between processes on the same box by using shared memory). The API entry points for zero-copy messaging are nn_allocmsg and nn_freemsg functions in combination with NN_MSG option passed to send/recv functions.
and it support mode "bus",  http://tim.dysinger.net/posts/2013-09-16-getting-started-with-nanomsg.html

so I write a simple demo for howto implement a p2p network based this.
 https://github.com/pch957/nanomsg_p2pnode

wish this can help improve the p2p network's efficient.

I remember posting about ZeroMQ a while ago. I think Charles also mentioned something and could be a person who can talk about it more.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
nanomsg is a real zero-copy msg server
Quote
Zero-Copy

While ZeroMQ offers a "zero-copy" API, it's not true zero-copy. Rather it's "zero-copy till the message gets to the kernel boundary". From that point on data is copied as with standard TCP. nanomsg, on the other hand, aims at supporting true zero-copy mechanisms such as RDMA (CPU bypass, direct memory-to-memory copying) and shmem (transfer of data between processes on the same box by using shared memory). The API entry points for zero-copy messaging are nn_allocmsg and nn_freemsg functions in combination with NN_MSG option passed to send/recv functions.
and it support mode "bus",  http://tim.dysinger.net/posts/2013-09-16-getting-started-with-nanomsg.html

so I write a simple demo for howto implement a p2p network based this.
 https://github.com/pch957/nanomsg_p2pnode

wish this can help improve the p2p network's efficient.
« Last Edit: September 29, 2015, 06:34:58 am by alt »