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

2018-01-27 Thread Justin Karneges
All that seems fine, but to get TCP keepalives to use a shorter timeout
you'll want to set those additional options, yes.
For example, in my apps I use:

ZMQ_TCP_KEEPALIVE = 1
ZMQ_TCP_KEEPALIVE_IDLE = 30
ZMQ_TCP_KEEPALIVE_INTVL = 5
ZMQ_TCP_KEEPALIVE_CNT = 6

What this means is if there is 30 seconds of no I/O, then the peer will
be pinged every 5 seconds, up to 6 times, before closing the connection.
Thus, the connection should recover after about a minute.
If you don't set these additional options, then the OS defaults are
used, which can sometimes be hours (!) long.
Justin

On Sat, Jan 27, 2018, at 9:02 PM, Ravi Joshi via zeromq-dev wrote:
> Hi,
> 
> I am little confused. Let me first explain the scenario again.
> 
> There are 3 publishers written in C# language running on Windows 10
> OS. On the other hand, there are 3 subscribers written in C++ language
> running on Ubuntu 14.04 LTS OS. The mapping from publisher to
> subscriber is one to one.> 
> Now let me mention ZMQ socket configurations.
> Publisher configuration-
> SetOption(ZSocketOption.CONFLATE, 1);
> 
> Subscriber configuration-
> socket.setsockopt(ZMQ_SUBSCRIBE, "", 0); // allow all messages
> socket.setsockopt(ZMQ_RCVTIMEO, , sizeof(timeout)); // int
> timeout = 1000> socket.setsockopt(ZMQ_LINGER, , 
> sizeof(linger)); // int
> linger = 0> socket.setsockopt(ZMQ_CONFLATE, , 
> sizeof(conflate)); //
> int conflate = 1> socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive,
> sizeof(tcp_keepalive)); // int tcp_keepalive = 1> 
> Do the above configurations look fine? Or do you want me to change and
> try once?> 
> I am confused since I am not able to find that how to set HEARTBEAT in
> Publisher-Subscriber.  Any suggestions, please?> 
> Regarding ZMQ_TCP_KEEPALIVE_*, I found following three variables
> ZMQ_TCP_KEEPALIVE_IDLE, ZMQ_TCP_KEEPALIVE_CNT, and
> ZMQ_TCP_KEEPALIVE_INTVL. The values for these variables is not clear
> from the documentation. Any suggestions, please?> 
> 
> Thank you very much.
> 
> -
> Ravi
> 
> On Sunday, 28 January 2018 3:10 AM, Justin Karneges
>  wrote:> 
> 
> You'd still have to wait for the TCP keepalive to timeout the
> connection before it will recover. On Ubuntu this might be a very long
> time, so be sure to set all the ZMQ_TCP_KEEPALIVE_* options to ensure
> a shorter timeout.> 
> On Sat, Jan 27, 2018, at 2:27 AM, Ravi Joshi via zeromq-dev wrote:
>> Hi Justin,
>> 
>> I will check it using netstat.
>> 
>> Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that
>> after some time, Windows OS, where publishers are running, is showing
>> 0 MBPS transmission rate. After I restart subscribers in ROS on
>> Ubuntu, publishers start working. Please note that during this
>> process I am not restarting publishers at all.>> 
>> Below is the code snippet added to all subscribers-
>> 
>> int tcp_keepalive = 1;
>> 
>> zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive,
>> sizeof(tcp_keepalive));>> 
>> 
>>  -
>> Thanks
>> Ravi
>> 
>> 
>> On Saturday, 27 January 2018 5:36 PM, Justin Karneges
>>  wrote:>> 
>> 
>> One thing you might do is run netstat on both sides to see if the
>> connections are still listed. In a dead connection scenario, netstat
>> should no longer list the connection on the PUB side, but should
>> remain listing it on the SUB side.>> 
>> Note that it can take time for the PUB connection to give up. On
>> Linux, the default is something like 20 minutes after it dies, so
>> give the PUB side some extra time after messages stop transmitting.
>> If transmission hasn't worked for over 20 minutes and netstat is
>> still showing the connection on the PUB side, then the problem may be
>> something else.>> 
>> On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:
>>> Hi Justin,
>>> 
>>> Thank you very much. How do I make sure that I am getting dead
>>> connections?>>> 
>>> For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB
>>> sockets.>>> 
>>> I will tell you the status of it after sometime.
>>> 
>>> Thanks
>>> -
>>> Ravi
>>> Sent from Yahoo Mail for iPhone[1]
>>> 
>>> On Saturday, January 27, 2018, 3:27 PM, Justin Karneges
>>>  wrote: 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

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

2018-01-27 Thread Ravi Joshi via zeromq-dev
Hi,
I am little confused. Let me first explain the scenario again.
There are 3 publishers written in C# language running on Windows 10 OS. On the 
other hand, there are 3 subscribers written in C++ language running on Ubuntu 
14.04 LTS OS. The mapping from publisher to subscriber is one to one.
Now let me mention ZMQ socket configurations.Publisher configuration-    
SetOption(ZSocketOption.CONFLATE, 1);
Subscriber configuration-    socket.setsockopt(ZMQ_SUBSCRIBE, "", 0); // allow 
all messages    socket.setsockopt(ZMQ_RCVTIMEO, , sizeof(timeout)); // 
int timeout = 1000    socket.setsockopt(ZMQ_LINGER, , sizeof(linger)); 
// int linger = 0    socket.setsockopt(ZMQ_CONFLATE, , 
sizeof(conflate)); // int conflate = 1    socket.setsockopt(ZMQ_TCP_KEEPALIVE, 
_keepalive, sizeof(tcp_keepalive)); // int tcp_keepalive = 1
Do the above configurations look fine? Or do you want me to change and try once?
I am confused since I am not able to find that how to set HEARTBEAT in 
Publisher-Subscriber.  Any suggestions, please?
Regarding ZMQ_TCP_KEEPALIVE_*, I found following three variables 
ZMQ_TCP_KEEPALIVE_IDLE, ZMQ_TCP_KEEPALIVE_CNT, and ZMQ_TCP_KEEPALIVE_INTVL. The 
values for these variables is not clear from the documentation. Any 
suggestions, please?

Thank you very much.
-Ravi

On Sunday, 28 January 2018 3:10 AM, Justin Karneges  
wrote:
 

 #yiv3902569468 p.yiv3902569468MsoNormal, #yiv3902569468 
p.yiv3902569468MsoNoSpacing{margin:0;}You'd still have to wait for the TCP 
keepalive to timeout the connection before it will recover. On Ubuntu this 
might be a very long time, so be sure to set all the ZMQ_TCP_KEEPALIVE_* 
options to ensure a shorter timeout.

On Sat, Jan 27, 2018, at 2:27 AM, Ravi Joshi via zeromq-dev wrote:

Hi Justin,

I will check it using netstat.

Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that after some 
time, Windows OS, where publishers are running, is showing 0 MBPS transmission 
rate. After I restart subscribers in ROS on Ubuntu, publishers start working. 
Please note that during this process I am not restarting publishers at all.

Below is the code snippet added to all subscribers-

int tcp_keepalive = 1;

zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive, sizeof(tcp_keepalive));


 -
Thanks
Ravi


On Saturday, 27 January 2018 5:36 PM, Justin Karneges  
wrote:


One thing you might do is run netstat on both sides to see if the connections 
are still listed. In a dead connection scenario, netstat should no longer list 
the connection on the PUB side, but should remain listing it on the SUB side.

Note that it can take time for the PUB connection to give up. On Linux, the 
default is something like 20 minutes after it dies, so give the PUB side some 
extra time after messages stop transmitting. If transmission hasn't worked for 
over 20 minutes and netstat is still showing the connection on the PUB side, 
then the problem may be something else.

On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:

Hi Justin,

Thank you very much. How do I make sure that I am getting dead connections?

For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.

I will tell you the status of it after sometime.

Thanks
-
Ravi
Sent from Yahoo Mail for iPhone

On Saturday, January 27, 2018, 3:27 PM, Justin Karneges  
wrote:

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
> 

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

2018-01-27 Thread Justin Karneges
You'd still have to wait for the TCP keepalive to timeout the
connection before it will recover. On Ubuntu this might be a very long
time, so be sure to set all the ZMQ_TCP_KEEPALIVE_* options to ensure a
shorter timeout.
On Sat, Jan 27, 2018, at 2:27 AM, Ravi Joshi via zeromq-dev wrote:
> Hi Justin,
> 
> I will check it using netstat.
> 
> Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that after
> some time, Windows OS, where publishers are running, is showing 0 MBPS
> transmission rate. After I restart subscribers in ROS on Ubuntu,
> publishers start working. Please note that during this process I am
> not restarting publishers at all.> 
> Below is the code snippet added to all subscribers-
> 
> int tcp_keepalive = 1;
> 
> zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive,
> sizeof(tcp_keepalive));> 
> 
>  -
> Thanks
> Ravi
> 
> 
> On Saturday, 27 January 2018 5:36 PM, Justin Karneges
>  wrote:> 
> 
> One thing you might do is run netstat on both sides to see if the
> connections are still listed. In a dead connection scenario, netstat
> should no longer list the connection on the PUB side, but should
> remain listing it on the SUB side.> 
> Note that it can take time for the PUB connection to give up. On
> Linux, the default is something like 20 minutes after it dies, so give
> the PUB side some extra time after messages stop transmitting. If
> transmission hasn't worked for over 20 minutes and netstat is still
> showing the connection on the PUB side, then the problem may be
> something else.> 
> On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:
>> Hi Justin,
>> 
>> Thank you very much. How do I make sure that I am getting dead
>> connections?>> 
>> For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.>> 
>> I will tell you the status of it after sometime.
>> 
>> Thanks
>> -
>> Ravi
>> Sent from Yahoo Mail for iPhone[1]
>> 
>> On Saturday, January 27, 2018, 3:27 PM, Justin Karneges
>>  wrote:>>> 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 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 mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Links:

  1. https://overview.mail.yahoo.com/?.src=iOS
___
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-27 Thread Thomas Rodgers
“strat team” was supposed to be std::stringstream (Thanks for nothing
autocorrect!)

http://en.cppreference.com/w/cpp/io/basic_stringstream

On Sat, Jan 27, 2018 at 10:22 AM Thomas Rodgers 
wrote:

> Strings are the simplest. If you don’t need to parse the data on the C++
> side, just format it as a JSON map on the C++ side, stream it into a strat
> team, send the resulting string on the socket and use Python’s support for
> parsing JSON on the received strong. For instance.
>
> You can also send structured binary to Python, as I mentioned; the Python
> CTypes module (included with Python) will let you define accessors for that
> data. As long as the sending and receiving side are the same CPU
> architecture you don’t have to worry about endianess conversions.
>
> On Sat, Jan 27, 2018 at 9:13 AM Bernardo Augusto García Loaiza <
> botib...@gmail.com> wrote:
>
>> Hi Luca, this mean, then, with structured string or data is necessary
>> some middleware entity like GPB such as Thomas tell us ...
>>
>>
>> Bernardo Augusto García Loaiza
>> Ingeniero de Sistemas
>> Estudiante de Maestría en Ingeniería Informática - Universidad EAFIT
>> http://about.me/bgarcial
>>
>>
>> On Sat, Jan 27, 2018 at 10:07 AM, Luca Boccassi 
>> wrote:
>>
>>> Yes you can just send unstructured binary data or strings - Python has
>>> native helpers for strings, and CZMQ as well
>>>
>>> On Fri, 2018-01-26 at 21:27 -0500, Bernardo Augusto García Loaiza
>>> wrote:
>>> > 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
>>> > >> > py#L20>
>>> > 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 >> > m>
>>> > 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 >> > > > > rs.com>
>>> > > > > 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 

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

2018-01-27 Thread Thomas Rodgers
Strings are the simplest. If you don’t need to parse the data on the C++
side, just format it as a JSON map on the C++ side, stream it into a strat
team, send the resulting string on the socket and use Python’s support for
parsing JSON on the received strong. For instance.

You can also send structured binary to Python, as I mentioned; the Python
CTypes module (included with Python) will let you define accessors for that
data. As long as the sending and receiving side are the same CPU
architecture you don’t have to worry about endianess conversions.

On Sat, Jan 27, 2018 at 9:13 AM Bernardo Augusto García Loaiza <
botib...@gmail.com> wrote:

> Hi Luca, this mean, then, with structured string or data is necessary some
> middleware entity like GPB such as Thomas tell us ...
>
>
> Bernardo Augusto García Loaiza
> Ingeniero de Sistemas
> Estudiante de Maestría en Ingeniería Informática - Universidad EAFIT
> http://about.me/bgarcial
>
>
> On Sat, Jan 27, 2018 at 10:07 AM, Luca Boccassi 
> wrote:
>
>> Yes you can just send unstructured binary data or strings - Python has
>> native helpers for strings, and CZMQ as well
>>
>> On Fri, 2018-01-26 at 21:27 -0500, Bernardo Augusto García Loaiza
>> wrote:
>> > 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
>> > > > py#L20>
>> > 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 > > m>
>> > 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 > > > > > rs.com>
>> > > > > 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
>> > > > > > >

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

2018-01-27 Thread Bernardo Augusto García Loaiza
Hi Luca, this mean, then, with structured string or data is necessary some
middleware entity like GPB such as Thomas tell us ...


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


On Sat, Jan 27, 2018 at 10:07 AM, Luca Boccassi 
wrote:

> Yes you can just send unstructured binary data or strings - Python has
> native helpers for strings, and CZMQ as well
>
> On Fri, 2018-01-26 at 21:27 -0500, Bernardo Augusto García Loaiza
> wrote:
> > 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
> >  > py#L20>
> > 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  > m>
> > 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  > > > > rs.com>
> > > > > 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 

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

2018-01-27 Thread Luca Boccassi
Yes you can just send unstructured binary data or strings - Python has
native helpers for strings, and CZMQ as well

On Fri, 2018-01-26 at 21:27 -0500, Bernardo Augusto García Loaiza
wrote:
> 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
>  py#L20>
> 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  m>
> 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  > > > rs.com>
> > > > 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 

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

2018-01-27 Thread Luca Boccassi
I'm not sure if Windows has a working TCP Keepalive - you can try with
the heartbeats instead which are at the ZMQ layer, see ZMQ_HEARTBEAT_*

Also remember to set all these options BEFORE connect/bind or they
won't have any affect.

On Sat, 2018-01-27 at 13:51 +, Ravi Joshi via zeromq-dev wrote:
> Hi Tobias,
> 
> Thank you very much. How to send lower heartbeats? Do we need to set
> it using setsockopt?
> 
> By the way, at present following setsockopt are already set for all
> three subscribers-
> 
> 
> (1) ZMQ_SUBSCRIBE : Allow all messages
> 
> (2) ZMQ_RCVTIMEO :1000 ms
> (3) ZMQ_LINGER :1
> (4) ZMQ_CONFLATE :1
> (5) ZMQ_TCP_KEEPALIVE :1
> -
> Thanks
> Ravi
> 
> 
> On Saturday, 27 January 2018 10:05 PM, Tobias Elbert  otmail.com> wrote:
> 
> 
> 
> Hi Ravi, 
> 
> I recall having had this problem a while ago, too, in another
> project. I was using C# clrzmq3 bindings on either side. I never
> solved it directly but from memory I recall sending down heartbeats
> and once a subscriber hadn't received a heartbeat message for X
> seconds, I restarted it. 
> 
> 
> Cheers 
> Tobias
> 
> 
> 
> 
> 
> From: zeromq-dev  on behalf of
> Ravi Joshi via zeromq-dev 
> Sent: Saturday, January 27, 2018 11:27 AM
> To: ZeroMQ development list
> Cc: Ravi Joshi
> Subject: Re: [zeromq-dev] Publishers stops sending data after
> sometime. Subscriber is required to fix publisher 
>  
> Hi Justin,
> 
> I will check it using netstat.
> 
> Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that
> after some time, Windows OS, where publishers are running, is showing
> 0 MBPS transmission rate. After I restart subscribers in ROS on
> Ubuntu, publishers start working. Please note that during this
> process I am not restarting publishers at all.
> 
> Below is the code snippet added to all subscribers-
> 
> int tcp_keepalive = 1;
> zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive,
> sizeof(tcp_keepalive));
> 
>  -
> Thanks
> Ravi
> 
> 
> 
> On Saturday, 27 January 2018 5:36 PM, Justin Karneges  s.com> wrote:
> 
> 
> 
> One thing you might do is run netstat on both sides to see if the
> connections are still listed. In a dead connection scenario, netstat
> should no longer list the connection on the PUB side, but should
> remain listing it on the SUB side.
> 
> 
> Note that it can take time for the PUB connection to give up. On
> Linux, the default is something like 20 minutes after it dies, so
> give the PUB side some extra time after messages stop transmitting.
> If transmission hasn't worked for over 20 minutes and netstat is
> still showing the connection on the PUB side, then the problem may be
> something else.
> 
> 
> On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:
> 
> Hi Justin,
> > 
> > 
> > 
> > Thank you very much. How do I make sure that I am getting dead
> > connections?
> > 
> > 
> > 
> > For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB
> > sockets.
> > 
> > 
> > 
> > I will tell you the status of it after sometime.
> > 
> > 
> > 
> > Thanks
> > 
> > -
> > 
> > Ravi
> > 
> > Sent from Yahoo Mail for iPhone
> > 
> > 
> > 
> > On Saturday, January 27, 2018, 3:27 PM, Justin Karneges  > neges.com> wrote:
> > 
> > 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 

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

2018-01-27 Thread Ravi Joshi via zeromq-dev
Hi Tobias,

Thank you very much. How to send lower heartbeats? Do we need to set it using 
setsockopt?

By the way, at present following setsockopt are already set for all three 
subscribers-


(1) ZMQ_SUBSCRIBE : Allow all messages

(2) ZMQ_RCVTIMEO :1000 ms
(3) ZMQ_LINGER :1
(4) ZMQ_CONFLATE :1
(5) ZMQ_TCP_KEEPALIVE :1
-
Thanks
Ravi


On Saturday, 27 January 2018 10:05 PM, Tobias Elbert 
 wrote:



Hi Ravi, 

I recall having had this problem a while ago, too, in another project. I was 
using C# clrzmq3 bindings on either side. I never solved it directly but from 
memory I recall sending down heartbeats and once a subscriber hadn't received a 
heartbeat message for X seconds, I restarted it. 


Cheers 
Tobias





From: zeromq-dev  on behalf of Ravi Joshi 
via zeromq-dev 
Sent: Saturday, January 27, 2018 11:27 AM
To: ZeroMQ development list
Cc: Ravi Joshi
Subject: Re: [zeromq-dev] Publishers stops sending data after sometime. 
Subscriber is required to fix publisher 
 
Hi Justin,

I will check it using netstat.

Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that after some 
time, Windows OS, where publishers are running, is showing 0 MBPS transmission 
rate. After I restart subscribers in ROS on Ubuntu, publishers start working. 
Please note that during this process I am not restarting publishers at all.

Below is the code snippet added to all subscribers-

int tcp_keepalive = 1;
zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive, sizeof(tcp_keepalive));

 -
Thanks
Ravi



On Saturday, 27 January 2018 5:36 PM, Justin Karneges  
wrote:



One thing you might do is run netstat on both sides to see if the connections 
are still listed. In a dead connection scenario, netstat should no longer list 
the connection on the PUB side, but should remain listing it on the SUB side.


Note that it can take time for the PUB connection to give up. On Linux, the 
default is something like 20 minutes after it dies, so give the PUB side some 
extra time after messages stop transmitting. If transmission hasn't worked for 
over 20 minutes and netstat is still showing the connection on the PUB side, 
then the problem may be something else.


On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:

Hi Justin,
>
>
>
>Thank you very much. How do I make sure that I am getting dead connections?
>
>
>
>For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.
>
>
>
>I will tell you the status of it after sometime.
>
>
>
>Thanks
>
>-
>
>Ravi
>
>Sent from Yahoo Mail for iPhone
>
>
>
>On Saturday, January 27, 2018, 3:27 PM, Justin Karneges  
>wrote:
>
>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 mailing list
>
>zeromq-dev@lists.zeromq.org
>

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

2018-01-27 Thread Tobias Elbert
Hi Ravi,


I recall having had this problem a while ago, too, in another project. I was 
using C# clrzmq3 bindings on either side. I never solved it directly but from 
memory I recall sending down heartbeats and once a subscriber hadn't received a 
heartbeat message for X seconds, I restarted it.

Cheers
Tobias


From: zeromq-dev  on behalf of Ravi Joshi 
via zeromq-dev 
Sent: Saturday, January 27, 2018 11:27 AM
To: ZeroMQ development list
Cc: Ravi Joshi
Subject: Re: [zeromq-dev] Publishers stops sending data after sometime. 
Subscriber is required to fix publisher

Hi Justin,

I will check it using netstat.

Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that after some 
time, Windows OS, where publishers are running, is showing 0 MBPS transmission 
rate. After I restart subscribers in ROS on Ubuntu, publishers start working. 
Please note that during this process I am not restarting publishers at all.

Below is the code snippet added to all subscribers-

int tcp_keepalive = 1;
zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive, sizeof(tcp_keepalive));

 -
Thanks
Ravi



On Saturday, 27 January 2018 5:36 PM, Justin Karneges  
wrote:


One thing you might do is run netstat on both sides to see if the connections 
are still listed. In a dead connection scenario, netstat should no longer list 
the connection on the PUB side, but should remain listing it on the SUB side.

Note that it can take time for the PUB connection to give up. On Linux, the 
default is something like 20 minutes after it dies, so give the PUB side some 
extra time after messages stop transmitting. If transmission hasn't worked for 
over 20 minutes and netstat is still showing the connection on the PUB side, 
then the problem may be something else.

On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:
Hi Justin,

Thank you very much. How do I make sure that I am getting dead connections?

For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.

I will tell you the status of it after sometime.

Thanks
-
Ravi
Sent from Yahoo Mail for iPhone

On Saturday, January 27, 2018, 3:27 PM, Justin Karneges  
wrote:
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 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 mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


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

2018-01-27 Thread Ravi Joshi via zeromq-dev
Hi Justin,
I will check it using netstat.
Meanwhile, ZMQ_TCP_KEEPALIVE seems not working. I still see that after some 
time, Windows OS, where publishers are running, is showing 0 MBPS transmission 
rate. After I restart subscribers in ROS on Ubuntu, publishers start working. 
Please note that during this process I am not restarting publishers at all.
Below is the code snippet added to all subscribers-
int tcp_keepalive = 1;zmq_socket.setsockopt(ZMQ_TCP_KEEPALIVE, _keepalive, 
sizeof(tcp_keepalive));
 -ThanksRavi
 

On Saturday, 27 January 2018 5:36 PM, Justin Karneges  
wrote:
 

 #yiv0196066097 p.yiv0196066097MsoNormal, #yiv0196066097 
p.yiv0196066097MsoNoSpacing{margin:0;}One thing you might do is run netstat on 
both sides to see if the connections are still listed. In a dead connection 
scenario, netstat should no longer list the connection on the PUB side, but 
should remain listing it on the SUB side.

Note that it can take time for the PUB connection to give up. On Linux, the 
default is something like 20 minutes after it dies, so give the PUB side some 
extra time after messages stop transmitting. If transmission hasn't worked for 
over 20 minutes and netstat is still showing the connection on the PUB side, 
then the problem may be something else.

On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:

Hi Justin,

Thank you very much. How do I make sure that I am getting dead connections?

For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.

I will tell you the status of it after sometime.

Thanks
-
Ravi
Sent from Yahoo Mail for iPhone

On Saturday, January 27, 2018, 3:27 PM, Justin Karneges  
wrote:

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 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 mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


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

2018-01-27 Thread Justin Karneges
One thing you might do is run netstat on both sides to see if the
connections are still listed. In a dead connection scenario, netstat
should no longer list the connection on the PUB side, but should remain
listing it on the SUB side.
Note that it can take time for the PUB connection to give up. On Linux,
the default is something like 20 minutes after it dies, so give the PUB
side some extra time after messages stop transmitting. If transmission
hasn't worked for over 20 minutes and netstat is still showing the
connection on the PUB side, then the problem may be something else.
On Sat, Jan 27, 2018, at 12:13 AM, Ravi Joshi via zeromq-dev wrote:
> Hi Justin,
> 
> Thank you very much. How do I make sure that I am getting dead
> connections?> 
> For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.> 
> I will tell you the status of it after sometime.
> 
> Thanks
> -
> Ravi
> Sent from Yahoo Mail for iPhone[1]
> 
> On Saturday, January 27, 2018, 3:27 PM, Justin Karneges
>  wrote:>> 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 mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Links:

  1. https://overview.mail.yahoo.com/?.src=iOS
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


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

2018-01-27 Thread Ravi Joshi via zeromq-dev
Hi Justin,
Thank you very much. How do I make sure that I am getting dead connections?
For time being, I am enabling ZMQ_TCP_KEEPALIVE on all 3 SUB sockets.
I will tell you the status of it after sometime.

Thanks-Ravi
Sent from Yahoo Mail for iPhone


On Saturday, January 27, 2018, 3:27 PM, Justin Karneges  
wrote:

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 mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev