ZeroMessageQueue (0MQ) is a library that provides a flexible messaging subsystem. Here you can find three bindings that make 0MQ available from the Red/System, REBOL 3 and REBOL 2 programming languages.LicenceThe source code of the bindings and the binary versions on this page are licensed to you under a BSD open source licence:- Red binding - REBOL 3 binding - REBOL 2 binding This licence does not apply to other parts, such as this documentation, for which all rights are reserved, and the 0MQ library, which is under the LGPL licence. |
|
Reporting IssuesThe source code of the Red and REBOL 2 bindings and the program examples is kept in Fossil repositories:- Red binding - REBOL 2 binding You can explore the source code there and use the ticket system of each repository to report issues. See the home page for other methods to contact us and discuss about all bindings, including the REBOL 3 binding. |
|
How to Install REBOL 3Before you can use the extension, you need REBOL 3 on your computer. See here for instructions on downloading and installing it. |
|
Installing the 0MQ Library0MQ is available for multiple operating systems. You will need to find a binary installation package for your system and follow the appropriate installation instructions. If your system has a central software management facility or packages listing, you should try that first. |
|
Installing the BindingDon't be alarmed by the small size of the downloads. They're much smaller than this web page. :-)The source code versions of the bindings are configured for a version of 0MQ of at least 2.0.7. The Red/System binding currently only works on Windows, because Red can't load libraries on other systems yet. It must be compiled from the source code by including it in a program. The REBOL 2 binding can be loaded from the source code as-is on Linux, Mac and Windows. For other systems, the path to the C library may have to be adjusted: ZeroMQ-binding.r2 Here's our main binary version of the REBOL 3 extension, for Syllable and Linux systems: ZeroMQ-binding.so This version was compiled on Syllable Server 0.4. It should also be usable on most other Linux systems for IA-32 (486 compatible) processors. It should be usable on 64 bits systems if they have 32 bits compatibility support installed. This extension needs a version of 0MQ not higher than 2.0.6. This is the version available for Ubuntu Linux 10.10 systems and derivatives. If you have a different system or 0MQ version, and both REBOL 3 and 0MQ are available for your system, you will have to compile the binding from its source code, as described further on. The extension doesn't need to be unpacked and doesn't necessarily need to be installed. It's a single file that is a dynamic (shared) library. It can be loaded into REBOL from any place. If you want to refer to it without explicitly specifying the path, the file needs to be installed in a standard library location, where the operating system can find it. Refer to instructions for your system on how to do that. |
|
How to Install the Binding on SyllableOn Syllable Server, if you want to install the REBOL 3 binding in the system for future use, the easiest way to do that is by moving theZeroMQ-binding.so file to the /system/libraries/ directory. |
|
How to Install the Binding on WindowsThe REBOL 3 extension must be compiled on Windows from the source code.The REBOL 2 binding can be loaded from the source code as-is. The Red binding must be compiled from the source code by including it in a program. Two demo programs are available that show a basic client/server request/reply example, where the client program sends ten “Hello” messages over a local loopback network connection and the server responds with a “World” message: reply-server.exe (3 KB) request-client.exe (3 KB) In the likely case that you don't have 0MQ installed yet, the libzmq.dll library can be extracted from the external package here:0MQ library The easiest way to use it is to simply put the library file in the same folder as the programs. You may also need to install an MSVC Redistributable Package if it isn't installed on your computer yet. At the time of writing, the 2008 version was needed (but a newer version may be more appropriate): MSVC Redistributable Package 2008 SP1 |
|
Using the BindingFor information about the meaning of the library interface, please refer to the 0MQ documentation and the following examples. More examples will be added here over time. |
|
Request/Reply Client/ServerThis request/reply example has a server program that keeps running, waiting for requests. The client program sends ten messages over a local loopback network connection with the content “Hello”. The server replies each message with a “World” message.Here is the example code for Red/System: reply-server.reds request-client.reds For REBOL 3: reply-server.r3 request-client.r3 For REBOL 2: reply-server.r2 request-client.r2 |
|
Source CodeThe source code of the Red and REBOL 2 bindings and the program examples is kept in Fossil repositories:- http://red.esperconsultancy.nl/Red-ZeroMQ-binding - http://rebol.esperconsultancy.nl/REBOL-2-ZeroMQ-binding You can use these links in Fossil commands, or you can use them in a web browser to explore the source code and report issues. Archives of the latest versions can be downloaded here: - Red-ZeroMQ-binding.zip - REBOL-2-ZeroMQ-binding.zip The source code of the REBOL 3 binding is kept in the build system of the Syllable operating systems, but it's not hard to use it on other systems: - REBOL 3 binding |
|
How to Use FossilFossil is a modern, distributed version control system, that you can use to access the source code of these projects and keep it up-to-date. See here for instructions on installing and using Fossil. |
|
Compiling the BindingREBOL 3 is available for several computer platforms. In principle, the REBOL 3 binding can be compiled on all of them. No changes to the binding itself should be necessary, but the build environment needs to be set up and the build configuration may need some changes. This is all standard procedure for compiling C programs, so you will need to follow the procedures for your system. The configuration of the extension is made with POSIX systems in mind. If you want to compile it on Windows, it is easiest to do that in the MinGW build environment.The binding needs the REBOL 3 open host environment as a base to compile on, so you need to download that, as well. The source code of the open host kit is hosted in a Git repository. You can either put the files of the binding in the root directory of the host kit, or if you put them in a separate work directory, you will have to adjust the makefile of the extension to point to the REBOL host environment. The makefile is also where you may have to make other changes for your environment. It is preconfigured for Linux and Syllable systems. There are hints in there for compiling on Windows in the MinGW environment.When the makefile is configured, doing the compilation is standard procedure. In most cases, all that is needed is the following command, given in a terminal in the same directory as the makefile and the binding source files: makeThe result should be an extra binary file called ZeroMQ-binding.so (it may have a different file extension on your system). If this failed, error messages will have been printed that you can use to sort out the problem. |
|
How to Compile the Binding on Syllable ServerThe REBOL 3 binding can be compiled on Syllable Server by following the general procedure, described above. However, it's much easier to let the Syllable build system do all the work of downloading both the binding and the REBOL host kit, installing them and then compiling the extension. In any case, you need to have the following software packs installed:- Development files pack for your exact Syllable version - Developer's Delight - Network Necessities Then enter the following commands: s build update build log build ZeroMQ-Binding--current build logThe resulting binary file ZeroMQ-binding.so will be in the directory ZeroMQ-Binding--current. |