[solved] Zeromq (delphi bindings) and Lazarus lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- cpicanco · 2015-01-13 22:17 Hi, First, I need to say that I am an enthusiastic programmer (not a professional one) and I choose to use Lazarus to write programs for my research. This solution that I am about to point out avoided a re- write of a program from pascal to python and avoided a re-write of the delphi zeromq bindings. I have described this (ugly) solution elsewhere to receive messages from inside a free pascal program sent by a zeromq publisher protocol, so please take a look: http://codereview.stackexchange.com/questions/75653/sync-eye- movements-with-external-events-python-%C3%98mq-zeromq Feel free to request any other relevant information. I have two questions and I would be immensely grateful with any help: 1) have any of you ever tried to use the delphi bindings with Lazarus and have had success? 2) do you know any better solution to communicate directly with zeromq? Best Rafael EDIT 1: the codereview question was updated working code here https://github.com/cpicanco/validation_project/blob/master/units/clien t.pas ---------------------------------------------------------------------- engkin · 2015-01-13 23:34 According to its readme file: QuoteThis is a binding for ZMQ. Should work with Delphi7+ versions and with FPC 2.6.0. Is that the version of FPC you used? QuoteThe package contains a wrapper (zmq.pas), and a higher level api (zmqapi.pas). Which one you used zmq.pas or zmqapi.pas? QuoteIt should work with ZMQ 2.2.x, and with 3.2.x. For version 2.2.x undefine zmq3, in zmq.inc. What version of ZMQ are you trying to use? Reading quickly through your code linked above, I don't think you are getting a socket using TZMQSocket. It should be through the context: Code: [Select]socket := context.Socket( ... ); If RcvTimeout is in milliseconds (I don't know if it is) then 5 is too small. ---------------------------------------------------------------------- cpicanco · 2015-01-14 01:42 To give you a quick response: __ Free Pascal FPC 2.6.2 0mq version Stable Release 3.2.5 Binding I am not sure. __ Let me try again with the FPC 2.6.0 __ For instance, is there a way to use two compilers, choose the compiler conditionally? I am afraid of downgrade everything and create more problems. Or should I install a clean version? For example: http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64% 20DEB/Old%20releases/Lazarus%201.0.6/ How may I proceed? ---------------------------------------------------------------------- engkin · 2015-01-14 02:44 No, you don't need to downgrade. I do not see a reason for it. I do not see "Stable Release 3.2.5" for Windows on the official distribution link. I do see it mentioned here What OS are you using? I suggest that you rewrite this simple python code in pascal and post your implementation here if it failed to work. I do see clearly that you commented out some pascal code that does *not* replicate gettimestamp.py. ---------------------------------------------------------------------- cpicanco · 2015-01-14 04:09 Ubuntu 13.10. http://zeromq.org/bindings:delphi Now I can see why so many errors. Hey, do not laugh. Again, how may I proceed? ---------------------------------------------------------------------- engkin · 2015-01-14 04:17 It might need a few adjustments to work on your OS. Unfortunately I'm a Windows person. But there are better members here that do work on Linux.  Wait a few hours and see ---------------------------------------------------------------------- cpicanco · 2015-03-22 03:47 Finally! Just fixed some missing compiler conditionals and it works just fine! (even with a stand by of some months, it took just 2 days to make a complete rewrite of the zmq communication system of the program refered in EDIT1, in the first post) https://github.com/bvarga/delphizmq