Class: NNQ::PAIR0

Inherits:
Socket show all
Defined in:
lib/nnq/pair.rb

Overview

PAIR (nng pair0): exclusive bidirectional channel with a single peer. First peer to connect wins; subsequent peers are dropped until the current one disconnects. No SP header on the wire.

Instance Attribute Summary

Attributes inherited from Socket

#options

Instance Method Summary collapse

Methods inherited from Socket

#all_peers_gone, bind, #bind, #close, #close_read, connect, #connect, #connection_count, #frozen_binary, #initialize, #last_endpoint, #monitor, #peer_connected, #raw?, #reconnect_enabled, #reconnect_enabled=

Constructor Details

This class inherits a constructor from NNQ::Socket

Instance Method Details

#receiveObject



18
19
20
# File 'lib/nnq/pair.rb', line 18

def receive
  Reactor.run { @engine.routing.receive }
end

#send(body) ⇒ Object



12
13
14
15
# File 'lib/nnq/pair.rb', line 12

def send(body)
  body = frozen_binary(body)
  Reactor.run { @engine.routing.send(body) }
end