[zeromq-dev] how to receive a message into a static buffer?

Pieter Hintjens ph at imatix.com
Tue May 5 12:00:08 CEST 2009


On Tue, May 5, 2009 at 11:01 AM, Martin Sustrik <sustrik at fastmq.com> wrote:

>> 1. pass the address and length of a local variable to the wrapper and
>> have it copy the data to the local variable
>
> Yes, however, if the message is larger then the variable, it'll result
> in error. I belive you are speaking about COBOL here, right? IIRC the
> variables in COBOL are fixed-length, so it may be actually the right way
> to handle the issue.

COBOL can work with pointers in various ways; it does not (or did not,
maybe it changed), have pointer operators as such but it can pass
32-bit or 64-bit values to subroutines which if written in C can do
pointer work on them.  To actually access the data behind the pointer
would require a call to a copy function.  The maximum size of a COBOL
variable depends on the compiler.  2^^16 used to be typical.

-Pieter



More information about the zeromq-dev mailing list