Re: [zeromq-dev] libzmq not working in a custom embedded linux box

2016-07-20 Thread 王运来


it's correct I think.
you need run `make`.after `./configure`





At 2016-07-21 00:42:10, "Alejandro Javier Schwoykoski"  
wrote:

Hello all,


I have a device that runs a customized (more like handcrafted) embedded Linux 
with a resident application that controls the whole device. I was asked to 
develop a daemon program which basically implements a special web service 
(REST) that forwards external requests to the resident program and pushes 
asynchronous notifications from the resident program to external peers (the 
resident program is like a backend for this new service). I was also asked to 
create the communication library that integrates both programs and I thought it 
was a good scenario to use zmq+czmq (a req/rep and a pub/sub) instead of 
implementing it from scratch.


Given that the target is a rather old and a non-standard Linux distro I first 
wanted to confirm that the zmq library works. I was able to cross compile the 
library and tests correctly as well as the "hello world" examples of the zguide 
but they do not run as expected in the target. Specifically, I checked the 
"test_reqrep_ipc" and the hwserver/hwclient programs. I noticed that the 
programs do run correctly but on socket receive operations they just block 
forever (context creation, socket bind and connect do work). I tried different 
builds of zmq (using autotools and cmake, shared lib, static lib, with debug, 
no debug, etc) and the result was always the same.

Does anyone know what can be the issue?


FYI, here is some information of the target and cross tool:

# uname -a
Linux ASC8848A 2.6.28.9-Mozart-8G #37 PREEMPT Fri Jun 3 14:59:58 PDT 2016 
armv5tejl unknown


chaicko@gauss:~$ arm-unknown-linux-uclibcgnueabi-g++ -v
Using built-in specs.
Target: arm-unknown-linux-uclibcgnueabi
Configured with: 
/home_3/jack.zhan/buildroot/buildroot-2010.11-r46561-opt/output/toolchain/gcc-4.3.5/configure
 --prefix=/opt/Mozart_toolchain/arm-eabi-uclibc//usr 
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu 
--target=arm-unknown-linux-uclibcgnueabi --enable-languages=c,c++ 
--with-sysroot=/opt/Mozart_toolchain/arm-eabi-uclibc/ 
--with-build-time-tools=/opt/Mozart_toolchain/arm-eabi-uclibc//usr/arm-unknown-linux-uclibcgnueabi/bin
 --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-libssp 
--disable-multilib --disable-tls --enable-shared 
--with-gmp=/home_3/jack.zhan/buildroot/buildroot-2010.11-r46561-opt/output/toolchain/gmp
 
--with-mpfr=/home_3/jack.zhan/buildroot/buildroot-2010.11-r46561-opt/output/toolchain/mpfr
 --disable-nls --enable-threads --disable-decimal-float --with-float=soft 
--with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm926ej-s 
--with-pkgversion='Buildroot 2010.11' --with-bugurl=http://bugs.buildroot.net/
Thread model: posix
gcc version 4.3.5(Buildroot 2010.11)




You can find the output from ./configure here: http://pastebin.com/pVFf5x09

Thank you for your help.


--
Alejandro J. Schwoykoski

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

[zeromq-dev] libzmq not working in a custom embedded linux box

2016-07-20 Thread Alejandro Javier Schwoykoski
Hello all,

I have a device that runs a customized (more like handcrafted) embedded
Linux with a resident application that controls the whole device. I was
asked to develop a daemon program which basically implements a special web
service (REST) that forwards external requests to the resident program and
pushes asynchronous notifications from the resident program to external
peers (the resident program is like a backend for this new service). I was
also asked to create the communication library that integrates both
programs and I thought it was a good scenario to use zmq+czmq (a req/rep
and a pub/sub) instead of implementing it from scratch.

Given that the target is a rather old and a non-standard Linux distro I
first wanted to confirm that the zmq library works. I was able to cross
compile the library and tests correctly as well as the "hello world"
examples of the zguide but they do not run as expected in the target.
Specifically, I checked the "test_reqrep_ipc" and the hwserver/hwclient
programs. I noticed that the programs do run correctly but on socket
receive operations they just block forever (context creation, socket bind
and connect do work). I tried different builds of zmq (using autotools and
cmake, shared lib, static lib, with debug, no debug, etc) and the result
was always the same.

Does anyone know what can be the issue?

FYI, here is some information of the target and cross tool:

# uname -a
Linux ASC8848A *2.6.28.9*-Mozart-8G #37 PREEMPT Fri Jun 3 14:59:58 PDT 2016
armv5tejl unknown

chaicko@gauss:~$ arm-unknown-linux-uclibcgnueabi-g++ -v
Using built-in specs.
Target: arm-unknown-linux-uclibcgnueabi
Configured with:
/home_3/jack.zhan/buildroot/buildroot-2010.11-r46561-opt/output/toolchain/gcc-4.3.5/configure
--prefix=/opt/Mozart_toolchain/arm-eabi-uclibc//usr
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=arm-unknown-linux-uclibcgnueabi --enable-languages=c,c++
--with-sysroot=/opt/Mozart_toolchain/arm-eabi-uclibc/
--with-build-time-tools=/opt/Mozart_toolchain/arm-eabi-uclibc//usr/arm-unknown-linux-uclibcgnueabi/bin
--disable-__cxa_atexit --enable-target-optspace --with-gnu-ld
--disable-libssp --disable-multilib --disable-tls --enable-shared
--with-gmp=/home_3/jack.zhan/buildroot/buildroot-2010.11-r46561-opt/output/toolchain/gmp
--with-mpfr=/home_3/jack.zhan/buildroot/buildroot-2010.11-r46561-opt/output/toolchain/mpfr
--disable-nls --enable-threads --disable-decimal-float --with-float=soft
--with-abi=aapcs-linux --with-arch=armv5te --with-tune=arm926ej-s
--with-pkgversion='Buildroot 2010.11' --with-bugurl=
http://bugs.buildroot.net/
Thread model: posix
*gcc version 4.3.5 *(Buildroot 2010.11)


You can find the output from ./configure here: http://pastebin.com/pVFf5x09

Thank you for your help.

--
Alejandro J. Schwoykoski
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] How to get client's identity

2016-07-20 Thread Bharat Somani
Hi David,

Thanks for your reply.

Gone through your message, but I am still not able to figure out the API to
be used for add & retrieve metadata in the message.

Do anyone know how to add/retrieve the metadata  in/from the message?

Also what all properties are supported in zmq_msg_set()

Thanks in advance.

Regards,
Bharat



On Wed, Jul 20, 2016 at 4:14 PM, David Jelenc 
wrote:

> Bharat,
>
> unfortunately, I do not have an example at hand. AFAIK, it was fairly
> straightforward. I was using zmqpp bindings:
>
> - you set up a ZAP handler that authenticates clients (CURVE in my case),
> - then, whenever a client connects, ZAP handler authenticates it,
> - and from then on each message is equipped with additional properties
> describing the client.
>
> See this thread for some more pointers:
>
> http://lists.zeromq.org/mailman/private/zeromq-dev/2016-May/030487.html
> (read it bottm-up)
>
> Best,
> David
>
> PS Just to be clear -- PUSH and PULL sockets still won't have the identity
> property, but you should be able to identify clients based on their
> credentials.
>
> On 20. 07. 2016 07:39, Bharat Somani wrote:
>
>> Hi,
>>
>> Can you point to any API/example which will facilitate the addition of
>> key-value (meta-data) pairs in the message sent from client?
>> I tried to search with respect to ZAP and found that it only facilitates
>> the type of authentication to be used. But I am not able to locate any
>> API which add/retrieve the key value pairs.
>>
>>
>> Regards,
>> Bharat
>>
>> On Tue, Jul 19, 2016 at 7:17 PM, David Jelenc
>> > wrote:
>>
>> Another option would also be to use ZAP to authenticate clients.
>> Once a client is authenticated, key-value (meta-data) pairs are
>> added to each message so you always know whom each message came from.
>>
>> On 19. 07. 2016 15:45, Diego Fons wrote:
>>
>> Hi,
>>
>> ZMQ_IDENTITY is used only with DEALER socket. You can not
>> retrive client
>> information with PUSH/PULL sockets (they are not implemented for
>> this).
>>
>> You can:
>> 1) Re-implement your application to use DEALER/ROUTER or
>> 2) Implement an abstraction layer that provides client
>> identification
>> (ie. build your own protocol).
>>
>> I'd choose the first one, but I don't know the main purpose of the
>> application.
>>
>> Regards.
>>
>> On Tue, Jul 19, 2016 at 9:31 AM, Bharat Somani
>> 
>> >
>> >> wrote:
>>
>>
>>  Hi All,
>>
>>  I have a process A which is creating ZMQ_PULL type of
>> socket and
>>  bind on some port.
>>
>>  Now I have process B, C, D (all on same system) which all
>> creates
>>  ZMQ_PUSH types of sockets in each process respectively and
>> connects
>>  to the port on same system on which process A is bind to.
>>
>>  In process A I am using API zmq_msg_recv() for receiving the
>>  messages. Now I want to identify the process (A or B or C)
>> from
>>  which that message is received.
>>  is there any way to know which process has sent this message?
>>
>>  I tried to set the ZMQ_IDENTITY in client processes (B,C &
>> D) but
>>  dont know how to get the identity from received message on
>> the
>>  server process A
>>
>>  Any pointer in this regard?
>>
>>
>>
>>  --
>>  With warm regards,
>>  Bharat
>>
>>  ___
>>  zeromq-dev mailing list
>> zeromq-dev@lists.zeromq.org 
>> > >
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
>>
>>
>> --
>> Diego Andrés Fons
>> Intraway Corp.
>> Solution Developer
>> AR Office: +54 (11) 6040 4000
>> US Office: +1 (516) 620 3890
>> Email: diego.f...@intraway.com 
>> >
>>
>> Visit our website at http://www.intraway.com
>> 
>> Proud to be an ISO 9001:2008 certified company
>>
>>
>> ___
>> zeromq-dev mailing list
>> zeromq-dev@lists.zeromq.org 
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>> ___
>> zeromq-dev mailing list
>> zeromq-dev@lists.zeromq.org