Nanomsg
NANOMSG is a socket library ZEROMQ written by the author in C, with the same usage and pattern as ZEROMQ, but with better performance and a more complete interface.
First download the source code
wget Https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz-O nanomsg-1.0.0.tar.gz
First make sure you have installed gcc gcc-c++ python-devel cmake on Ubuntu, if not executed
Apt-get install gcc gcc-c++ python-devel cmake
Compiling and installing nanomsg
TAR-ZXVF NANOMSG-1.0.0.TAR.GZCD Nanomsg-1.0.0mkdir bulid# This step if there is a problem, you need to remove CMakeCache.txt re-CMAKECD Buildcmake: CMake--build. # Perform Test ctest-c Debug. # install CMake--build. --target Installldconfig
Installation and Commissioning
PIP3 Install Nnpy
Installation test
Import nnpypub = Nnpy. Socket (NNPY.AF_SP, Nnpy. PUB) pub.bind (' Inproc://foo ') sub = Nnpy. Socket (NNPY.AF_SP, Nnpy. SUB) sub.connect (' Inproc://foo ') sub.setsockopt (nnpy. SUB, Nnpy. Sub_subscribe, ') pub.send (' Hello, World ') print (SUB.RECV ())
If execution succeeds, you are done.
Note: If you need to install NANOMSG, you need to install, download the installation package, go to directory execution
Python setup.py Install
Can
Install Nanomsg and Nnpy under Ubuntu