[zeromq-dev] How to send/receive a custom C++ object via zeromq.

2013-09-28 Thread Riskybiz
I've managed to fix the problem and now am able to use boost::serialization to pass serialized data via zeromq. I've posted the test program code below in case it might be of use to someone else trying to do the same in future..There is a class declaration, a server program and a client program. T

Re: [zeromq-dev] How to send/receive a custom C++ object via zeromq?

2013-09-27 Thread Bjorn Reese
On 09/27/2013 12:49 PM, Riskybiz wrote: > When this is received at the client end it is a jumbled mess of random > characters. Where do you observe the garbage first? In reply, repStr, buffer or obj1? ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.

[zeromq-dev] How to send/receive a custom C++ object via zeromq?

2013-09-27 Thread Riskybiz
Trying to get to grips with how to serialize an object and send/receive it via zeromq I've modified the Hello World example from the zeromq documentation to try and achieve this. Code is below. Whilst the server appears to be outputting a sensible: Sent Reply: 22 serialization::archive 10

Re: [zeromq-dev] How to send/receive a custom C++ object via zeromq

2013-09-25 Thread Bjorn Reese
On 09/25/2013 06:43 PM, Riskybiz wrote: > object and get it onto, across, and off the wire with zeromq. Might > this involve serializing to a memory buffer? Hoped someone might be Yes. The archive takes an std::ostream argument so instead of using std::ofstream, you can just use std::ostringstr

[zeromq-dev] How to send/receive a custom C++ object via zeromq

2013-09-25 Thread Riskybiz
Thanks for the tips last week Bjorn. I like the idea of using boost::serialization. I've been looking at this blog to get familiar with the basics: http://www.ocoudert.com/blog/2011/07/09/a-practical-guide-to-c-serialization / All the simple examples I am able to find serialize the object

Re: [zeromq-dev] How to send/receive a custom C++ object via zeromq sockets?

2013-09-18 Thread Bjorn Reese
On 09/17/2013 06:27 PM, Riskybiz wrote: > I have the notion that I’d like to try encapsulating each line of the > data to be sent in a custom class object object instance; then serialize > each object, pass it through the REQ-REP sockets and deserialise to > reconstruct the object at the client en

Re: [zeromq-dev] How to send/receive a custom C++ object via zeromq sockets?

2013-09-17 Thread Michael Haberler
Am 18.09.2013 um 04:53 schrieb Michael Scofield : > I strongly recommend Google's Protocol Buffer as the > serialization/deserialization tool. It's fast, convenient and robust. It > directly transform an object to the bytes formation(and vice-versa), so can > be send/recv through zeromq socket

Re: [zeromq-dev] How to send/receive a custom C++ object via zeromq sockets?

2013-09-17 Thread Michael Scofield
I strongly recommend Google's Protocol Buffer as the serialization/deserialization tool. It's fast, convenient and robust. It directly transform an object to the bytes formation(and vice-versa), so can be send/recv through zeromq sockets. We are using it in our online game, and it works well so

Re: [zeromq-dev] How to send/receive a custom C++ object via zeromq sockets?

2013-09-17 Thread Pieter Hintjens
There are lots of ways to serialize data. In your case you could simply send the comma-delimited data as a single string and parse that at the receiver side. On Tue, Sep 17, 2013 at 6:27 PM, Riskybiz wrote: > So, I’ve got a working implementation of a zeromq REQ-REP socket pattern and > am using

[zeromq-dev] How to send/receive a custom C++ object via zeromq sockets?

2013-09-17 Thread Riskybiz
So, I've got a working implementation of a zeromq REQ-REP socket pattern and am using it to pass data in the form of character strings between a server and several clients, like so: Sample comma separated data strings sent as a multipart message (of several thousand parts), each line is a complete