BitShares Forum

Main => General Discussion => Topic started by: alt on September 29, 2015, 06:33:00 am

Title: a sample for build p2p network based nanomsg
Post by: alt on September 29, 2015, 06:33:00 am
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.
Title: Re: a sample for build p2p network based nanomsg
Post by: luckybit on September 29, 2015, 05:16:45 pm
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.