Basic Binding

Introduction

If you want some background, read the broad overview at:

http://www.coastrd.com/zeromq-messaging

Currently headers exist for BASIC flavors:

  • FreeBasic - (Windows/Mac/Linux)
  • PureBasic - (Windows/Mac/Linux)
  • PowerBasic - (Windows)

libzmq.dll

If you know how to operate a C++ compiler, you can create the latest ØMQ Dll by downloading and compiling the source code from the development trunk here:

http://github.com/sustrik/zeromq2

If this is little more than you can/want to get into for the moment, just download the compiled windows 32 bit Dll here:

http://www.coastrd.com/download

The Dll exposes ØMQ API for windows using the standard C calling convention (CDECL). VB uses STDCALL convention but there are workarounds for this.

If you need to write to Mac/Linux/Win64, you will need to compile for yourself.

Example Code

Compilable example code (Request/Response pattern) for:
Server
Client

The examples have a small ASM function for copying memory to avoid including windows.h just to get the function definition for copymem().

The examples have some error handling included and create a plain text debug file to get you going.

Documentation

The procedural steps are:

Client

    * zmq_init
    * zmq_socket  (ZMQ_REQ)
    * zmq_connect
    * zmq_msg_init_size
    * zmq_msg_data
    * zmq_send
    * zmq_msg_init
    * zmq_recv
    * zmq_msg_size
    * zmq_msg_data
    * recover response
    * zmq_msg_close
    * zmq_close
    * zmq_term

Server

    * zmq_init
    * zmq_socket (ZMQ_REP)
    * zmq_bind
    * zmq_msg_init
    * zmq_recv
    * zmq_msg_size
    * zmq_msg_data
    * recover request
    * zmq_msg_close
    * zmq_msg_init_size
    * zmq_msg_data
    * zmq_send
    * zmq_msg_close
    * zmq_close
    * zmq_term

Each of these functions is covered in the online manual.

Contributing

If you would like to contribute the headers for other BASIC flavors, or have feedback, e-mail:

ZeroMQ A T coastrd D O T com

Mailing List

Discussions about this language binding take place on the general zeromq-dev list.