[zeromq-dev] Windows Form Application is not sending any data after 5-6 hours

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

I hope that the new year is going well. I am using ZeroMQ inside Windows Form 
application in C#. The ZeroMQ is using Publisher-Subscriber pattern and 
consists of 3 publishers to publish 3 different types of data. The code snippet 
is available in Pastebin (https://pastebin.com/S65LmwuV). 

The application works well initially and successfully transmits data at 700MBPS 
rate but stops transmitting any data after 5-6 hours. There is no error 
reported in Visual Studio. However, when I see the "Task Manager" in PC 
(Windows 10), the ethernet shows 0Kbps.

How do I debug this issue and make it working? 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-25 Thread Bernardo Augusto García Loaiza
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:
>>>
>>> import time
>>> import zmq
>>>
>>> context = zmq.Context()
>>> socket = context.socket(zmq.REP)
>>> socket.bind("tcp://*:")
>>> print('ZMQ Server listening ... ')
>>>
>>> while True:
>>> # Wait for next request from client
>>> message = socket.recv()
>>> print("Received message from Sofa: {}".format(message))
>>> # print("Received message from c++ %s" % message)
>>>
>>> # Do some 'work'
>>> time.sleep(1)
>>>
>>> # Send reply back to client
>>> # socket.send(b"Hola cliente, muy bien y tu ?")
>>> # print('Response sent')
>>>
>>>
>>>
>>> The output or the message which arrive to python zmq server is 

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

2018-01-25 Thread Bernardo Augusto García Loaiza
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:
>>
>> import time
>> import zmq
>>
>> context = zmq.Context()
>> socket = context.socket(zmq.REP)
>> socket.bind("tcp://*:")
>> print('ZMQ Server listening ... ')
>>
>> while True:
>> # Wait for next request from client
>> message = socket.recv()
>> print("Received message from Sofa: {}".format(message))
>> # print("Received message from c++ %s" % message)
>>
>> # Do some 'work'
>> time.sleep(1)
>>
>> # Send reply back to client
>> # socket.send(b"Hola cliente, muy bien y tu ?")
>> # print('Response sent')
>>
>>
>>
>> The output or the message which arrive to python zmq server is the
>> symbols characters of the btnState:
>>
>> (cnvss_test) ➜  Python git:(ZMQCommunication) ✗ python server.py
>> ZMQ Server listening ...
>> *Received message from Sofa: b"\x00'\x84)\xff\x7f\x00\x00\x98&*"
>>
>> Likely, As I in my python server I am representing like  a string message
>> arrived and I am sending from my c++ client a int btnState data,
>> then I try convert int to string in  the python server side:
>>
>> And I replace this line
>>
>> print("Received message from Sofa: {}".format(message))
>>
>> by thiis line
>>
>> 

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

2018-01-25 Thread Kevin Sapper
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" :

On Wed, Jan 24, 2018 at 9:54 PM, Luca Boccassi 
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