33.2. ZeroMQ

$ sudo apt-get install zeromq-bin libzmq0 libzmq-dev libzmq-dbg
	

33.2.1. python-zeromq

sudo add-apt-repository ppa:chris-lea/zeromq
sudo apt-get update
        
sudo apt-get install python-zeromq
        
33.2.1.1. pyzmq

http://zeromq.github.com/pyzmq/

$ sudo apt-get install autoconf automake
$ sudo pip install pyzmq
		    
$ git clone git://github.com/zeromq/pyzmq.git
$ cd pyzmq
$ python setup.py configure --zmq=/path/to/zmq/prefix
$ python setup.py install
            
easy_install pyzmq
            
33.2.1.2. example

例 33.2. server.py

$ cat server.py
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://127.0.0.1:5000")

while True:
    msg = socket.recv()
    print "Got", msg
    socket.send(msg)
                

例 33.3. client.py

$ cat client.py
import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://127.0.0.1:5000")

for i in range(10):
    msg = "msg %s" % i
    socket.send(msg)
    print "Sending", msg
    msg_in = socket.recv()
                

33.2.2. ruby zmq

sudo gem install zmq
      



原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

make[1]: Entering directory '/openwrt/openwrt-15.05.1' make[2]: Entering directory '/openwrt/openwrt-15.05.1/package/helloworld/helloworld' rm -f /openwrt/openwrt-15.05.1/bin/ar71xx/packages/base/helloworld_* rm -f /openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/._installed rm -f /openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/packages/.list /openwrt/openwrt-15.05.1/staging_dir/host/packages/.list rm -rf /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/helloworld-1.0 make[2]: Leaving directory '/openwrt/openwrt-15.05.1/package/helloworld/helloworld' make[1]: Leaving directory '/openwrt/openwrt-15.05.1' make[1]: Entering directory '/openwrt/openwrt-15.05.1' make[2]: Entering directory '/openwrt/openwrt-15.05.1/package/libs/toolchain' mkdir -p /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain touch /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/.prepared_0c0f7031f78967ca687e5628984dfab9 rm -f /openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.toolchain_installed (cd /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/./; if [ -x ./configure ]; then find /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/ -name config.guess | xargs -r chmod u+w; find /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/ -name config.guess | xargs -r -n1 cp --remove-destination /openwrt/openwrt-15.05.1/scripts/config.guess; find /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/ -name config.sub | xargs -r chmod u+w; find /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/ -name config.sub | xargs -r -n1 cp --remove-destination /openwrt/openwrt-15.05.1/scripts/config.sub; AR="mips-openwrt-linux-uclibc-gcc-ar" AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM="mips-openwrt-linux-uclibc-gcc-nm" CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB="mips-openwrt-linux-uclibc-gcc-ranlib" STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 " CPPFLAGS="-I/openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/openwrt/openwrt-15.05.1/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib " ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; ) rm -f /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/.configured_* touch /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/.configured_yyy cp -fpR /openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libuClibc-*.so /openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libcrypt-*.so /openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libm-*.so /openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libpthread-*.so /openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/ cp: cannot stat '/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libuClibc-*.so': No such file or directory cp: cannot stat '/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libcrypt-*.so': No such file or directory cp: cannot stat '/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libm-*.so': No such file or directory cp: cannot stat '/openwrt/openwrt-15.05.1/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libpthread-*.so': No such file or directory Makefile:636: recipe for target '/openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/.built' failed make[2]: *** [/openwrt/openwrt-15.05.1/build_dir/target-mips_34kc_uClibc-0.9.33.2/toolchain/.built] Error 1 make[2]: Leaving directory '/openwrt/openwrt-15.05.1/package/libs/toolchain' package/Makefile:191: recipe for target 'package/libs/toolchain/compile' failed make[1]: *** [package/libs/toolchain/compile] Error 2 make[1]: Leaving directory '/openwrt/openwrt-15.05.1' /openwrt/openwrt-15.05.1/include/toplevel.mk:181: recipe for target 'package/helloworld/compile' failed make: *** [package/helloworld/compile] Error 2
08-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值