Skip to content

hcarty/ocaml-zmq3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ocaml-zmq3

ZeroMQ 3 bindings for OCaml

Requirements

Install:

$ make install

Uninstall

$ make uninstall

Examples (interpreter)

Send/Receive

let c = Zmq.init 1;;
let s1 = Zmq.socket c Zmq.rep;;
let s2 = Zmq.socket c Zmq.req;;
Zmq.bind s1 "tcp://*:5555";;
Zmq.connect s2 "tcp://localhost:5555";;
Zmq.send s2 "Hello";;
let msg = Zmq.recv s1;;
Zmq.close s1;;
Zmq.close s2;;
Zmq.term c;;

Using options

let c = Zmq.init 1;;
let s1 = Zmq.socket c Zmq.rep;;
Zmq.setsockopt s1 Zmq.subscribe "lol";;
Zmq.close s1;;
Zmq.term c;;

More

Check the examples folder. Compile the examples with:

$ make example

Thanks

  • wagerlabs (Joel Reymont) - implemented poll and the typing of sockets with variants
  • little-arhat (Roman Sokolov) - implemented the file descriptor option
  • bashi-bazouk (Brian Ledger) - inspired the new implementation for the socket options

Copyright

Copyright (C) 2011 Pedro Borges and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

The ZMQ 3.0 branch is dead, this project will be updated to be compatible with the future 3.2 release

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published