Re: [zeromq-dev] Publishers stops sending data after sometime. Subscriber is required to fix publisher

2018-01-26 Thread Justin Karneges
Hi,

One issue with socket types that don't usually write data (such as SUB) is that 
a dead connection might go unnoticed forever. You can work around this by 
enabling TCP keep alives on the SUB socket. I don't know if you're getting dead 
connections here but just thought I'd mention it.

Justin

On Fri, Jan 26, 2018, at 9:33 PM, Ravi Joshi via zeromq-dev wrote:
> Hi,
> 
> I am using Publisher-Subscriber pattern consisting of 3 publishers to 
> publish 3 different types of data. All 3 publishers are written in a 
> single C# file. However, each subscriber is written in a separate C++ 
> file inside ROS. From the point of ZeroMQ, there is no difference in 
> each subscriber, since context, socket initialization and receiving 
> message is done in the same way for all subscriber. Hence, in order to 
> make the mail shorter, I am just posting code snippet of 1 
> subscriber below.
> 
> The publisher code in C# snippet is available in Pastebin 
> (https://pastebin.com/S65LmwuV).
> The subscriber code in C++ snippet is available in Pastebin 
> (https://pastebin.com/xb3V0n0u).
> 
> The publisher works well initially for some time and successfully 
> transmits data at 700MBPS rate but stops transmitting any data after 5-6 
> hours.
> 
> In order to make publisher working again, I need to restart the 
> subscribers. This is strange to me since it is unexpected behavior as 
> per the Publisher-Subscriber pattern is concerned.
> 
> Why such weird behavior? Any workaround, please.
> 
> -
> Thanks
> Ravi
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Publishers stops sending data after sometime. Subscriber is required to fix publisher

2018-01-26 Thread Ravi Joshi via zeromq-dev
Hi,

I am using Publisher-Subscriber pattern consisting of 3 publishers to publish 3 
different types of data. All 3 publishers are written in a single C# file. 
However, each subscriber is written in a separate C++ file inside ROS. From the 
point of ZeroMQ, there is no difference in each subscriber, since context, 
socket initialization and receiving message is done in the same way for all 
subscriber. Hence, in order to make the mail shorter, I am just posting code 
snippet of 1 
subscriber below.

The publisher code in C# snippet is available in Pastebin 
(https://pastebin.com/S65LmwuV).
The subscriber code in C++ snippet is available in Pastebin 
(https://pastebin.com/xb3V0n0u).

The publisher works well initially for some time and successfully transmits 
data at 700MBPS rate but stops transmitting any data after 5-6 hours.

In order to make publisher working again, I need to restart the subscribers. 
This is strange to me since it is unexpected behavior as per the 
Publisher-Subscriber pattern is concerned.

Why such weird behavior? Any workaround, please.

-
Thanks
Ravi
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Communication between C++ zmq client and Python zmq Server

2018-01-26 Thread Bernardo Augusto García Loaiza
Thomas, I understand perfectly your explanation. But I want share with you
another similar case, just for curiosity or to receive some additional
orientation about it.

I have a script client C++ ZEROMQ  as a documentation, and I have script
server python, together based in the documentation zeromq website.
This mean, together are scripts basics

>From C++ client I am sending the string message
  and
I have a python server which receive this string message client

of  a direct way and show me their content

In this basic sample (documentation zmq based) I am not using  structures
data  members. Is for this reason that in this case I receive and I can see
the content of the client message in the zmq server side without have use
something like Google Protocol Buffer, This mean, is because in this case I
am not sending any structures data  members?

I appreciate one more your orientation


Bernardo Augusto García Loaiza
Ingeniero de Sistemas
Estudiante de Maestría en Ingeniería Informática - Universidad EAFIT
http://about.me/bgarcial


On Fri, Jan 26, 2018 at 7:44 AM, Thomas Rodgers 
wrote:

> Short answer yes, it’s related to different languages. TCP and ZeroMQ only
> deal with transport and framing of messages (respectively) Python has no
> idea that that 10 bytes corresponds to a C/C++ struct of a given layout
> until you tell it. Different platforms (CPU architectures) have potentially
> different representations of fundamental types.
>
> On Thu, Jan 25, 2018 at 4:37 PM Bernardo Augusto García Loaiza <
> botib...@gmail.com> wrote:
>
>> One more question. Why is necessary the serialization process? It is
>> assumed that zeromq works via TCP and in the TCP protocol, the data does
>> not undergo any transformation? This is related with the fact of that I
>> have different platform/languages?
>>
>> On Thu, Jan 25, 2018 at 4:45 PM Bernardo Augusto García Loaiza <
>> botib...@gmail.com> wrote:
>>
>>> Hi Thomas,
>>> Thanks for your illustrative response
>>>
>>> I'll look Google Protocol Buffers. My sender is from C++ language and
>>> my reception is Python. What sort of installation recommend me you?
>>> Binaries or build protocol buffer along my C++ runtime? or o build protoc
>>> binary from source?
>>>
>>> On Wed, Jan 24, 2018 at 8:36 PM Thomas Rodgers 
>>> wrote:
>>>
 You can have a look at Python’s ctypes module, which will let you
 define a ‘struct’ from Python with the same layout as your C++ struct.

 You can also investigate any number of serialization libraries that
 have C++ and Python support, eg ProtoBufs or Thrift, or MagPack or 
 whatever.

 On Wed, Jan 24, 2018 at 5:26 PM Bernardo Augusto García Loaiza <
 botib...@gmail.com> wrote:

> Hi, ZMQ people.
> Greetings.
>
>
> I have a  C++ zeromq client process in which I am sending some data
> members structures
>
> *ZMQComponent.h* file
>
>
> #include 
> #include 
>
> // To Quat datatype
> #include 
> using sofa::defaulttype::Quat;
>
> using std::string;
>
> namespace sofa
> {
>
> namespace component
> {
>
> namespace controller
> {
>
> /* data structure which I want send data to python zmq server */
> struct instrumentData
> {
> typedef sofa::defaulttype::Vec3d Vec3d;
> Vec3d pos;
> Quat quat;
> int btnState;
> float openInst;
> bool blnDataReady;
> };
>
> class ZMQComponent : public sofa::core::behavior::BaseController
> {
> public:
> SOFA_CLASS(ZMQComponent, sofa::core::behavior::BaseController);
>
> ZMQComponent();
> virtual ~ZMQComponent();
> /* Conect to ZMQ external python Server */
> void setupConnection();
>
> /* Send some data memeber instrumentData structure to ZMQ external
> Server */
> void instrumentDataSend(instrumentData a);
>
> /* initialize function */
> void init();
>
> };
>
> } // namespace sofa
>
> } // namespace component
>
> } // namespace controller
>
>
> The *ZMQComponent.cpp* is:
>
> #include 
> #include 
> #include 
> #include 
> #include "ZMQComponent.h"
>
>
> using namespace std;
>
> namespace sofa
> {
>
> namespace component
> {
>
> namespace controller
> {
>
> /* ZMQ Internal Client context and socket */
> zmq::context_t context(1);
> zmq::socket_t socket(context, ZMQ_REQ);
>
> ZMQComponent::ZMQComponent(){}
>
> void ZMQComponent::setupConnection()
> {
> cout << "Connecting to python zeroMQ server ..." << endl;
> socket.connect("tcp://localhost:");
> }
>
> void 

Re: [zeromq-dev] Communication between C++ zmq client and Python zmq Server

2018-01-26 Thread Bernardo Augusto García Loaiza
Thanks Thomas. Best Regards :)

On Fri, Jan 26, 2018 at 7:44 AM Thomas Rodgers 
wrote:

> Short answer yes, it’s related to different languages. TCP and ZeroMQ only
> deal with transport and framing of messages (respectively) Python has no
> idea that that 10 bytes corresponds to a C/C++ struct of a given layout
> until you tell it. Different platforms (CPU architectures) have potentially
> different representations of fundamental types.
>
> On Thu, Jan 25, 2018 at 4:37 PM Bernardo Augusto García Loaiza <
> botib...@gmail.com> wrote:
>
>> One more question. Why is necessary the serialization process? It is
>> assumed that zeromq works via TCP and in the TCP protocol, the data does
>> not undergo any transformation? This is related with the fact of that I
>> have different platform/languages?
>>
>> On Thu, Jan 25, 2018 at 4:45 PM Bernardo Augusto García Loaiza <
>> botib...@gmail.com> wrote:
>>
>>> Hi Thomas,
>>> Thanks for your illustrative response
>>>
>>> I'll look Google Protocol Buffers. My sender is from C++ language and
>>> my reception is Python. What sort of installation recommend me you?
>>> Binaries or build protocol buffer along my C++ runtime? or o build protoc
>>> binary from source?
>>>
>>> On Wed, Jan 24, 2018 at 8:36 PM Thomas Rodgers 
>>> wrote:
>>>
 You can have a look at Python’s ctypes module, which will let you
 define a ‘struct’ from Python with the same layout as your C++ struct.

 You can also investigate any number of serialization libraries that
 have C++ and Python support, eg ProtoBufs or Thrift, or MagPack or 
 whatever.

 On Wed, Jan 24, 2018 at 5:26 PM Bernardo Augusto García Loaiza <
 botib...@gmail.com> wrote:

> Hi, ZMQ people.
> Greetings.
>
>
> I have a  C++ zeromq client process in which I am sending some data
> members structures
>
> *ZMQComponent.h* file
>
>
> #include 
> #include 
>
> // To Quat datatype
> #include 
> using sofa::defaulttype::Quat;
>
> using std::string;
>
> namespace sofa
> {
>
> namespace component
> {
>
> namespace controller
> {
>
> /* data structure which I want send data to python zmq server */
> struct instrumentData
> {
> typedef sofa::defaulttype::Vec3d Vec3d;
> Vec3d pos;
> Quat quat;
> int btnState;
> float openInst;
> bool blnDataReady;
> };
>
> class ZMQComponent : public sofa::core::behavior::BaseController
> {
> public:
> SOFA_CLASS(ZMQComponent, sofa::core::behavior::BaseController);
>
> ZMQComponent();
> virtual ~ZMQComponent();
> /* Conect to ZMQ external python Server */
> void setupConnection();
>
> /* Send some data memeber instrumentData structure to ZMQ external
> Server */
> void instrumentDataSend(instrumentData a);
>
> /* initialize function */
> void init();
>
> };
>
> } // namespace sofa
>
> } // namespace component
>
> } // namespace controller
>
>
> The *ZMQComponent.cpp* is:
>
> #include 
> #include 
> #include 
> #include 
> #include "ZMQComponent.h"
>
>
> using namespace std;
>
> namespace sofa
> {
>
> namespace component
> {
>
> namespace controller
> {
>
> /* ZMQ Internal Client context and socket */
> zmq::context_t context(1);
> zmq::socket_t socket(context, ZMQ_REQ);
>
> ZMQComponent::ZMQComponent(){}
>
> void ZMQComponent::setupConnection()
> {
> cout << "Connecting to python zeroMQ server ..." << endl;
> socket.connect("tcp://localhost:");
> }
>
> void ZMQComponent::instrumentDataSend(instrumentData a)
> {
> /* Initialize the data members structure instrumentData */
> a.pos = sofa::defaulttype::Vec3d(1.0f, 1.0f, 1.0f);
> a.quat = defaulttype::Quat(1.0f, 1.0f, 4.0f, 1.0f);
> a.btnState = 5671;
> a.openInst = 1.0f;
> a.blnDataReady = false;
>
> /* We send the btnState data */
> zmq::message_t request(10);
> cout << "The data are: " << a.btnState;
>
> /* We ask for the memory address to ge the btnState content and send
> it. */
> memcpy(request.data(), , 10);
> socket.send(request);
> }
>
>
> /* In the init function we create the objects to setup connection and
> send data */
> void ZMQComponent::init()
> {
> std::cout << "ZeroMQCommunication::init()" << std::endl;
> ZMQComponent z;
> z.setupConnection();
>
> instrumentData itemp;
> z.instrumentDataSend(itemp);
> }
>
> /* Other code related  */
> ZMQComponent::~ZMQComponent(){}
>
> // int ZeroMqComponentClass = sofa::core::RegisterObject("This
> component does nothing.").add();
> SOFA_DECL_CLASS(ZMQServerComponent)
>
> int 

Re: [zeromq-dev] FOSDEM 2018 - ZeroMQ gathering/hackaton?

2018-01-26 Thread Simon.Giesecke
Hi,

I will arrive on Wednesday evening as well, so we could meet somewhere :) I am 
staying near the Etterbeek Station.

I have to leave somewhat early on Thursday, but will be there all day on Friday.

Best regards
Simon

-Ursprüngliche Nachricht-
Von: zeromq-dev [mailto:zeromq-dev-boun...@lists.zeromq.org] Im Auftrag von 
Luca Boccassi
Gesendet: Freitag, 26. Januar 2018 15:06
An: ZeroMQ development list ; Benjamin Henrion 

Betreff: Re: [zeromq-dev] FOSDEM 2018 - ZeroMQ gathering/hackaton?

Hi,

I'll try to be there early on Thursday as well.

I'll arrive Wednesday evening as well - anybody else? Shall we grab a beer 
somewhere?

On Thu, 2018-01-25 at 16:39 +0100, Kevin Sapper wrote:
> Hi Benjamin,
> 
> I'll arrive in Brussels on Wednesday evening and will be able to be at 
> HXBL on Thursday at 8am to take the keys.
> 
> See you next week.
> 
> Cheers
> Kevin
> 
> Am 24.01.2018 10:16 nachm. schrieb "Benjamin Henrion"  om>:
> 
> On Wed, Jan 24, 2018 at 9:54 PM, Luca Boccassi  om>
> wrote:
> > On Sun, 2017-08-27 at 18:20 +0100, Luca Boccassi wrote:
> > > Hello,
> > > 
> > > FOSDEM 2018 dates have been announced, it will be on Saturday 3rd 
> > > and Sunday 4th of February. [1]
> > > 
> > > Would people be interested in replicating last year's 2-days ZMQ 
> > > gathering/hackaton before FOSDEM?
> > > 
> > > Benjamin, would the hacker space we were at be available again?
> > > 
> > > Kind regards,
> > > Luca Boccassi
> > > 
> > > [1] 
> > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2
> > > Ffosdem.org%2F2018%2F=02%7C01%7Csimon.giesecke%40btc-ag.com%7
> > > C432335de320a441d168b08d564c5e94b%7Cc064efb078954eebb406a40bc377bc
> > > 7d%7C0%7C0%7C636525723555358409=zCmhZD5gtcWl%2BlknT4yE5Dh08X
> > > NgCtmLzaayqLkE5zI%3D=0
> > 
> > Hey all,
> > 
> > Just a week to go!
> > 
> > If you have proposed an idea for the hackaton, and it requires some 
> > non-trivial setup or dependencies, could you please consider 
> > preparing a short how-to before the event and post it as a comment 
> > on the page?
> > 
> > https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fze
> > romq.org%2Fevent%3Azeromq-pre-fosdem-hackaton-thu-1-fri-2-feb-=
> > 02%7C01%7Csimon.giesecke%40btc-ag.com%7C432335de320a441d168b08d564c5
> > e94b%7Cc064efb078954eebb406a40bc377bc7d%7C0%7C0%7C636525723555358409
> > =tjEsW9t3So5iIcnXRpcUTVEeaOlVDdtU%2BcD2LAM9nGY%3D=0
> > 2018
> > 
> > This way we can more easily and quickly bring who is interested up 
> > to speed.
> > 
> > I'll go first - I've built Ubuntu/Debian packages for DPDK and over 
> > the weekend I'll prepare a quick howto.
> 
> Some practical things:
> 
> 1. I will be there on Friday the whole day, on Thursday I will have to 
> work and I will come to open the doors of HSBXL early in the morning 
> (like 8am), and come back in the afternoon. There are 4 doors/gates to 
> pass, so I would need someone to be there with me to take the keys. I 
> will try to go there the day before, and warm up the place; 2. On the 
> friday evening at 6PM, there is a Kubernetes meetup with 40 people, so 
> I will need the help of you guys to move stuff around (tables, seats, 
> etc...), as I broke my back last year and I cannot lift heavy things;
> 
> See you next week!
> 
> --
> Benjamin Henrion (zoobab)
> Email: zoobab at gmail.com
> Mobile: +32-484-566109
> Web: 
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> zoobab.com=02%7C01%7Csimon.giesecke%40btc-ag.com%7C432335de320a44
> 1d168b08d564c5e94b%7Cc064efb078954eebb406a40bc377bc7d%7C0%7C0%7C636525
> 723555358409=KhpMWc8GB2rIBwQ8MZikVzGWNEtFQmIjK6h42gdLYKM%3D
> rved=0
> FFII.org Brussels
> "In July 2005, after several failed attempts to legalise software 
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of 
> software, they are now seeking to create a central European patent 
> court, which would establish and enforce patentability rules in their 
> favor, without any possibility of correction by competing courts or 
> democratically elected legislators."
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis
> ts.zeromq.org%2Fmailman%2Flistinfo%2Fzeromq-dev=02%7C01%7Csimon.g
> iesecke%40btc-ag.com%7C432335de320a441d168b08d564c5e94b%7Cc064efb07895
> 4eebb406a40bc377bc7d%7C0%7C0%7C636525723555358409=h9oDf61C8px9An
> n1xu46oCIYGJdiLa0iCQOtyi7agEw%3D=0
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis
> ts.zeromq.org%2Fmailman%2Flistinfo%2Fzeromq-dev=02%7C01%7Csimon.g
> iesecke%40btc-ag.com%7C432335de320a441d168b08d564c5e94b%7Cc064efb07895
> 

Re: [zeromq-dev] FOSDEM 2018 - ZeroMQ gathering/hackaton?

2018-01-26 Thread Benjamin Henrion
On Jan 26, 2018 15:48, "Osiris Pedroso"  wrote:

I will have to miss it.
My flight arrives on Thursday at 7:15am...

Do we plan anything for Saturday?


I am also organizing the sunxi dinner on saturday eve at 8pm-10pm, tell me
if you want to join.

Best,


On Fri, Jan 26, 2018 at 8:05 AM Luca Boccassi 
wrote:

> Hi,
>
> I'll try to be there early on Thursday as well.
>
> I'll arrive Wednesday evening as well - anybody else? Shall we grab a
> beer somewhere?
>
> On Thu, 2018-01-25 <20%2018%2001%2025> at 16:39 +0100, Kevin Sapper wrote:
> > Hi Benjamin,
> >
> > I'll arrive in Brussels on Wednesday evening and will be able to be
> > at HXBL
> > on Thursday at 8am to take the keys.
> >
> > See you next week.
> >
> > Cheers
> > Kevin
> >
> > Am 24.01.2018 10:16 nachm. schrieb "Benjamin Henrion"  > om>:
> >
> > On Wed, Jan 24, 2018 at 9:54 PM, Luca Boccassi  > om>
> > wrote:
> > > On Sun, 2017-08-27 <20%2017%2008%2027> at 18:20 +0100, Luca Boccassi
> wrote:
> > > > Hello,
> > > >
> > > > FOSDEM 2018 dates have been announced, it will be on Saturday 3rd
> > > > and
> > > > Sunday 4th of February. [1]
> > > >
> > > > Would people be interested in replicating last year's 2-days ZMQ
> > > > gathering/hackaton before FOSDEM?
> > > >
> > > > Benjamin, would the hacker space we were at be available again?
> > > >
> > > > Kind regards,
> > > > Luca Boccassi
> > > >
> > > > [1] https://fosdem.org/2018/
> > >
> > > Hey all,
> > >
> > > Just a week to go!
> > >
> > > If you have proposed an idea for the hackaton, and it requires some
> > > non-trivial setup or dependencies, could you please consider
> > > preparing
> > > a short how-to before the event and post it as a comment on the
> > > page?
> > >
> > > http://zeromq.org/event:zeromq-pre-fosdem-hackaton-thu-1-fri-2-feb-
> > > 2018
> > >
> > > This way we can more easily and quickly bring who is interested up
> > > to
> > > speed.
> > >
> > > I'll go first - I've built Ubuntu/Debian packages for DPDK and over
> > > the
> > > weekend I'll prepare a quick howto.
> >
> > Some practical things:
> >
> > 1. I will be there on Friday the whole day, on Thursday I will have
> > to
> > work and I will come to open the doors of HSBXL early in the morning
> > (like 8am), and come back in the afternoon. There are 4 doors/gates
> > to
> > pass, so I would need someone to be there with me to take the keys. I
> > will try to go there the day before, and warm up the place;
> > 2. On the friday evening at 6PM, there is a Kubernetes meetup with 40
> > people, so I will need the help of you guys to move stuff around
> > (tables, seats, etc...), as I broke my back last year and I cannot
> > lift heavy things;
> >
> > See you next week!
> >
> > --
> > Benjamin Henrion (zoobab)
> > Email: zoobab at gmail.com
> > Mobile: +32-484-566109 <+32%20484%2056%2061%2009>
> > Web: http://www.zoobab.com
> > FFII.org Brussels
> > "In July 2005, after several failed attempts to legalise software
> > patents in Europe, the patent establishment changed its strategy.
> > Instead of explicitly seeking to sanction the patentability of
> > software, they are now seeking to create a central European patent
> > court, which would establish and enforce patentability rules in their
> > favor, without any possibility of correction by competing courts or
> > democratically elected legislators."
> > ___
> > zeromq-dev mailing list
> > zeromq-dev@lists.zeromq.org
> > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> > ___
> > zeromq-dev mailing list
> > zeromq-dev@lists.zeromq.org
> > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> --
> Kind regards,
> Luca Boccassi___
>
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] FOSDEM 2018 - ZeroMQ gathering/hackaton?

2018-01-26 Thread Osiris Pedroso
I will have to miss it.
My flight arrives on Thursday at 7:15am...

Do we plan anything for Saturday?

On Fri, Jan 26, 2018 at 8:05 AM Luca Boccassi 
wrote:

> Hi,
>
> I'll try to be there early on Thursday as well.
>
> I'll arrive Wednesday evening as well - anybody else? Shall we grab a
> beer somewhere?
>
> On Thu, 2018-01-25 at 16:39 +0100, Kevin Sapper wrote:
> > Hi Benjamin,
> >
> > I'll arrive in Brussels on Wednesday evening and will be able to be
> > at HXBL
> > on Thursday at 8am to take the keys.
> >
> > See you next week.
> >
> > Cheers
> > Kevin
> >
> > Am 24.01.2018 10:16 nachm. schrieb "Benjamin Henrion"  > om>:
> >
> > On Wed, Jan 24, 2018 at 9:54 PM, Luca Boccassi  > om>
> > wrote:
> > > On Sun, 2017-08-27 at 18:20 +0100, Luca Boccassi wrote:
> > > > Hello,
> > > >
> > > > FOSDEM 2018 dates have been announced, it will be on Saturday 3rd
> > > > and
> > > > Sunday 4th of February. [1]
> > > >
> > > > Would people be interested in replicating last year's 2-days ZMQ
> > > > gathering/hackaton before FOSDEM?
> > > >
> > > > Benjamin, would the hacker space we were at be available again?
> > > >
> > > > Kind regards,
> > > > Luca Boccassi
> > > >
> > > > [1] https://fosdem.org/2018/
> > >
> > > Hey all,
> > >
> > > Just a week to go!
> > >
> > > If you have proposed an idea for the hackaton, and it requires some
> > > non-trivial setup or dependencies, could you please consider
> > > preparing
> > > a short how-to before the event and post it as a comment on the
> > > page?
> > >
> > > http://zeromq.org/event:zeromq-pre-fosdem-hackaton-thu-1-fri-2-feb-
> > > 2018
> > >
> > > This way we can more easily and quickly bring who is interested up
> > > to
> > > speed.
> > >
> > > I'll go first - I've built Ubuntu/Debian packages for DPDK and over
> > > the
> > > weekend I'll prepare a quick howto.
> >
> > Some practical things:
> >
> > 1. I will be there on Friday the whole day, on Thursday I will have
> > to
> > work and I will come to open the doors of HSBXL early in the morning
> > (like 8am), and come back in the afternoon. There are 4 doors/gates
> > to
> > pass, so I would need someone to be there with me to take the keys. I
> > will try to go there the day before, and warm up the place;
> > 2. On the friday evening at 6PM, there is a Kubernetes meetup with 40
> > people, so I will need the help of you guys to move stuff around
> > (tables, seats, etc...), as I broke my back last year and I cannot
> > lift heavy things;
> >
> > See you next week!
> >
> > --
> > Benjamin Henrion (zoobab)
> > Email: zoobab at gmail.com
> > Mobile: +32-484-566109 <+32%20484%2056%2061%2009>
> > Web: http://www.zoobab.com
> > FFII.org Brussels
> > "In July 2005, after several failed attempts to legalise software
> > patents in Europe, the patent establishment changed its strategy.
> > Instead of explicitly seeking to sanction the patentability of
> > software, they are now seeking to create a central European patent
> > court, which would establish and enforce patentability rules in their
> > favor, without any possibility of correction by competing courts or
> > democratically elected legislators."
> > ___
> > zeromq-dev mailing list
> > zeromq-dev@lists.zeromq.org
> > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> > ___
> > zeromq-dev mailing list
> > zeromq-dev@lists.zeromq.org
> > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> --
> Kind regards,
> Luca Boccassi___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] FOSDEM 2018 - ZeroMQ gathering/hackaton?

2018-01-26 Thread Luca Boccassi
Hi,

I'll try to be there early on Thursday as well.

I'll arrive Wednesday evening as well - anybody else? Shall we grab a
beer somewhere?

On Thu, 2018-01-25 at 16:39 +0100, Kevin Sapper wrote:
> Hi Benjamin,
> 
> I'll arrive in Brussels on Wednesday evening and will be able to be
> at HXBL
> on Thursday at 8am to take the keys.
> 
> See you next week.
> 
> Cheers
> Kevin
> 
> Am 24.01.2018 10:16 nachm. schrieb "Benjamin Henrion"  om>:
> 
> On Wed, Jan 24, 2018 at 9:54 PM, Luca Boccassi  om>
> wrote:
> > On Sun, 2017-08-27 at 18:20 +0100, Luca Boccassi wrote:
> > > Hello,
> > > 
> > > FOSDEM 2018 dates have been announced, it will be on Saturday 3rd
> > > and
> > > Sunday 4th of February. [1]
> > > 
> > > Would people be interested in replicating last year's 2-days ZMQ
> > > gathering/hackaton before FOSDEM?
> > > 
> > > Benjamin, would the hacker space we were at be available again?
> > > 
> > > Kind regards,
> > > Luca Boccassi
> > > 
> > > [1] https://fosdem.org/2018/
> > 
> > Hey all,
> > 
> > Just a week to go!
> > 
> > If you have proposed an idea for the hackaton, and it requires some
> > non-trivial setup or dependencies, could you please consider
> > preparing
> > a short how-to before the event and post it as a comment on the
> > page?
> > 
> > http://zeromq.org/event:zeromq-pre-fosdem-hackaton-thu-1-fri-2-feb-
> > 2018
> > 
> > This way we can more easily and quickly bring who is interested up
> > to
> > speed.
> > 
> > I'll go first - I've built Ubuntu/Debian packages for DPDK and over
> > the
> > weekend I'll prepare a quick howto.
> 
> Some practical things:
> 
> 1. I will be there on Friday the whole day, on Thursday I will have
> to
> work and I will come to open the doors of HSBXL early in the morning
> (like 8am), and come back in the afternoon. There are 4 doors/gates
> to
> pass, so I would need someone to be there with me to take the keys. I
> will try to go there the day before, and warm up the place;
> 2. On the friday evening at 6PM, there is a Kubernetes meetup with 40
> people, so I will need the help of you guys to move stuff around
> (tables, seats, etc...), as I broke my back last year and I cannot
> lift heavy things;
> 
> See you next week!
> 
> --
> Benjamin Henrion (zoobab)
> Email: zoobab at gmail.com
> Mobile: +32-484-566109
> Web: http://www.zoobab.com
> FFII.org Brussels
> "In July 2005, after several failed attempts to legalise software
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of
> software, they are now seeking to create a central European patent
> court, which would establish and enforce patentability rules in their
> favor, without any possibility of correction by competing courts or
> democratically elected legislators."
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

-- 
Kind regards,
Luca Boccassi

signature.asc
Description: This is a digitally signed message part
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Communication between C++ zmq client and Python zmq Server

2018-01-26 Thread Thomas Rodgers
Short answer yes, it’s related to different languages. TCP and ZeroMQ only
deal with transport and framing of messages (respectively) Python has no
idea that that 10 bytes corresponds to a C/C++ struct of a given layout
until you tell it. Different platforms (CPU architectures) have potentially
different representations of fundamental types.

On Thu, Jan 25, 2018 at 4:37 PM Bernardo Augusto García Loaiza <
botib...@gmail.com> wrote:

> One more question. Why is necessary the serialization process? It is
> assumed that zeromq works via TCP and in the TCP protocol, the data does
> not undergo any transformation? This is related with the fact of that I
> have different platform/languages?
>
> On Thu, Jan 25, 2018 at 4:45 PM Bernardo Augusto García Loaiza <
> botib...@gmail.com> wrote:
>
>> Hi Thomas,
>> Thanks for your illustrative response
>>
>> I'll look Google Protocol Buffers. My sender is from C++ language and my
>> reception is Python. What sort of installation recommend me you? Binaries
>> or build protocol buffer along my C++ runtime? or o build protoc binary
>> from source?
>>
>> On Wed, Jan 24, 2018 at 8:36 PM Thomas Rodgers 
>> wrote:
>>
>>> You can have a look at Python’s ctypes module, which will let you define
>>> a ‘struct’ from Python with the same layout as your C++ struct.
>>>
>>> You can also investigate any number of serialization libraries that have
>>> C++ and Python support, eg ProtoBufs or Thrift, or MagPack or whatever.
>>>
>>> On Wed, Jan 24, 2018 at 5:26 PM Bernardo Augusto García Loaiza <
>>> botib...@gmail.com> wrote:
>>>
 Hi, ZMQ people.
 Greetings.


 I have a  C++ zeromq client process in which I am sending some data
 members structures

 *ZMQComponent.h* file


 #include 
 #include 

 // To Quat datatype
 #include 
 using sofa::defaulttype::Quat;

 using std::string;

 namespace sofa
 {

 namespace component
 {

 namespace controller
 {

 /* data structure which I want send data to python zmq server */
 struct instrumentData
 {
 typedef sofa::defaulttype::Vec3d Vec3d;
 Vec3d pos;
 Quat quat;
 int btnState;
 float openInst;
 bool blnDataReady;
 };

 class ZMQComponent : public sofa::core::behavior::BaseController
 {
 public:
 SOFA_CLASS(ZMQComponent, sofa::core::behavior::BaseController);

 ZMQComponent();
 virtual ~ZMQComponent();
 /* Conect to ZMQ external python Server */
 void setupConnection();

 /* Send some data memeber instrumentData structure to ZMQ external
 Server */
 void instrumentDataSend(instrumentData a);

 /* initialize function */
 void init();

 };

 } // namespace sofa

 } // namespace component

 } // namespace controller


 The *ZMQComponent.cpp* is:

 #include 
 #include 
 #include 
 #include 
 #include "ZMQComponent.h"


 using namespace std;

 namespace sofa
 {

 namespace component
 {

 namespace controller
 {

 /* ZMQ Internal Client context and socket */
 zmq::context_t context(1);
 zmq::socket_t socket(context, ZMQ_REQ);

 ZMQComponent::ZMQComponent(){}

 void ZMQComponent::setupConnection()
 {
 cout << "Connecting to python zeroMQ server ..." << endl;
 socket.connect("tcp://localhost:");
 }

 void ZMQComponent::instrumentDataSend(instrumentData a)
 {
 /* Initialize the data members structure instrumentData */
 a.pos = sofa::defaulttype::Vec3d(1.0f, 1.0f, 1.0f);
 a.quat = defaulttype::Quat(1.0f, 1.0f, 4.0f, 1.0f);
 a.btnState = 5671;
 a.openInst = 1.0f;
 a.blnDataReady = false;

 /* We send the btnState data */
 zmq::message_t request(10);
 cout << "The data are: " << a.btnState;

 /* We ask for the memory address to ge the btnState content and send
 it. */
 memcpy(request.data(), , 10);
 socket.send(request);
 }


 /* In the init function we create the objects to setup connection and
 send data */
 void ZMQComponent::init()
 {
 std::cout << "ZeroMQCommunication::init()" << std::endl;
 ZMQComponent z;
 z.setupConnection();

 instrumentData itemp;
 z.instrumentDataSend(itemp);
 }

 /* Other code related  */
 ZMQComponent::~ZMQComponent(){}

 // int ZeroMqComponentClass = sofa::core::RegisterObject("This
 component does nothing.").add();
 SOFA_DECL_CLASS(ZMQServerComponent)

 int ZMQServerComponentClass = sofa::core::RegisterObject("This
 component create a Socket.").add< ZMQServerComponent >();
 } // namespace controller

 } // namespace component

 } // namespace sofa

 Then , my python zmq server  which receive the *btnState*  int
 variable is: