[zeromq-dev] how to receive a message into a static buffer?
Apps, John
john.apps at hp.com
Mon May 4 17:31:02 CEST 2009
There is a similar issue with the high-level language wrapper (available for all languages, at least on OpenVMS):
The output buffer is returned as an address, as we already know. All very well for lower-level languages that know how to deal with addresses, but not so good for those that do not, e.g., COBOL, FORTRAN.
There are, of course, runtime library routines on the platform(s) which would allow one to copy the data from the output buffer address to some local variable. My thought was not to use these as they tend to be platform specific, thus making the program harder to port.
The alternatives would appear to be:
1. pass the address and length of a local variable to the wrapper and have it copy the data to the local variable
2. add an additional call in the wrapper to perform the copy
My preference is 1. above as it would only change the behavior of the receive call in the wrapper, not of anything else.
PS: how long is the buffer available?
Cheers, John
---- John Apps | Hewlett-Packard | John.Apps at HP.com | +49 171 869 1813 ----
-----Original Message-----
From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Martin Sustrik
Sent: Monday, May 04, 2009 16:56
To: Aamir M
Cc: zeromq-dev at lists.zeromq.org
Subject: Re: [zeromq-dev] how to receive a message into a static buffer?
Aamir M wrote:
> Hi Martin,
>
> Is the concept of a user-provided receive buffer completely out of the
> question? What if the user provided 0MQ with a buffer and promised not
> to touch the buffer until it gets a pointer from 'receive'? Couldn't the
> copy be eliminated in this way? I think this would be a very useful
> feature for high performance streaming.
The problem remains: The data can be retrieved from the network even
before you supply the buffer. I don't see any way how to get around
that. Any ideas?
Martin
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list