Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why delphizmq not support ZEROMQ4? #25

Open
jfhyn opened this issue Jun 9, 2017 · 14 comments
Open

Why delphizmq not support ZEROMQ4? #25

jfhyn opened this issue Jun 9, 2017 · 14 comments

Comments

@jfhyn
Copy link

jfhyn commented Jun 9, 2017

hi,Why delphizmq not support ZEROMQ4?

@cpicanco
Copy link
Contributor

cpicanco commented Jun 9, 2017

This would be great. The recommendation of the libzmq devs is to automate zmq bindings through https://github.com/zeromq/zproject

I am not sure how the delphizmq zmqapi would behave though.

@bvarga
Copy link
Owner

bvarga commented Jun 9, 2017

@jfhyn : I don't work with zeromq lately, so there were no motivation for me to keep it up to date, I just started working on, what you can find is under the develop branch of this repo. However I would love to accept any pull requests.

@cpicanco : I would not go that direction (I admit I have not much knowledge about zproject), but I think it would be a much bigger project than just updating zmq.pas regularly.

@hgourvest
Copy link

@cpicanco libzmq is not compatible with ZProject but CZMQ and Zyre are compatibles. You should take a look on my fork here: https://github.com/hgourvest/zproject. It can generate Delphi API for both of them.

@cpicanco
Copy link
Contributor

cpicanco commented Jul 13, 2017 via email

@prosd
Copy link

prosd commented Aug 2, 2017

Hi, I'm looking for ZMQ V4 wrapper for Delphi XE7 (64 bits) or higher. Hope someone can help. Thank you in advance!

@cpicanco
Copy link
Contributor

cpicanco commented Aug 2, 2017 via email

@prosd
Copy link

prosd commented Aug 4, 2017

Thanks for the feedback. Meanwhile I installed V3.2.4 (32 Bit). Are there any plans to support the 64-bit version of ZMQ?

@cpicanco
Copy link
Contributor

cpicanco commented Aug 4, 2017

I am afraid currently there is no motivation for @bvarga to support 64bits. I have the motivation, but currently don't have enough expertise. Who knows in the future?

@prosd
Copy link

prosd commented Aug 5, 2017

Allright, again thank you for the prompt reply.
I downloaded the 4.2.2 FPC version and altered it to be compatible with Delphi (which was a relatively easy job, I must say). All looks good, except for the "zmq_bind" function: whatever I try to bind, it always returns error #22 (which is undocumented). Any ideas?

UPDATE: You can ignore my last question. I was using the PChar type which defaulted to PWideChar in XE7.

@tfrost
Copy link

tfrost commented Oct 26, 2017

@prosd - I would appreciate seeing the compatible-with-Delphi results of your 'relatively easy job' if you felt like sharing them! Or at least a summary of what you needed to change.

@PizzaProgram
Copy link

@prosd Yes, please share with us!

@TT-Sam
Copy link

TT-Sam commented Aug 7, 2023

In case this helps anyone, I was able to produce a modern (4.3.4) build of ZeroMQ, and to reuse the bindings here with one change:

in zmq.pas, I had to change
zmq_msg_t = record_: Array[0..32-1] of Byte;
to
zmq_msg_t = record_: Array[0..64-1] of Byte;

(See #zeromq/libzmq#1298)

Of course, you'll have to add any new features to the base classes still, but if all you want is a working Delphi build around the current dll, that should do it for you.

@TT-Sam
Copy link

TT-Sam commented May 17, 2024

In case this helps anyone (again), I was able to produce a modern (4.3.4) build of ZeroMQ in 64bit, and to reuse the bindings here in a 64bit Delphi 10 project with
-The change in my previous comment
-in zmq.pas, I had to change
size_t = Cardinal;
to
size_t = NativeUINT;

That specifically resolved some issues with getSockOpt and getSockOptInt64.
I can't promise that fixes everything, but we had a reasonably extensive test suite that this passes for.

I admit that I don't understand the exact nuances of that change, but I was advised "C++'s size_t and Delphi's Cardinal are not guaranteed to be the same size. size_t may be 32bit or 64bit depending on compiler, but Cardinal is always 32bit. Try using `NativeUint instead on the Delphi side." by the StackOverflow community.

@josdemmers
Copy link

josdemmers commented May 24, 2024

@TT-Sam Great! Looks like the change to NativeUINT finally solved my problem that multipart messages always stopped after receiving the first frame (when using 64bit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants