Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 446 Bytes

File metadata and controls

19 lines (13 loc) · 446 Bytes

OMQ::PEER

PEER socket type (RFC 51).

True peer-to-peer messaging. Each PEER can both bind and connect, routing by 4-byte connection ID.

Usage

require "omq"
require "omq/peer"

peer1 = OMQ::PEER.bind("tcp://127.0.0.1:5555")
peer2 = OMQ::PEER.connect("tcp://127.0.0.1:5555")

peer2 << "hello from peer2"
msg, routing_id = peer1.receive_with_routing_id
peer1.send_to(routing_id, "hello back")