Class: EZMQ::Pair

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

Overview

Pair sockets are meant to operate in pairs, as the name implies. They are

bi-directional, with a one-to-one relationship between endpoints. Either
end can send or receive messages.

Instance Attribute Summary

Attributes inherited from Socket

#context, #decode, #encode, #socket

Instance Method Summary (collapse)

Methods inherited from Socket

#connect, #listen, #receive, #send

Constructor Details

- (Pair) initialize(mode, **options)

Creates a new Pair socket.

Parameters:

  • mode (:bind, :connect)

    a mode for the socket.

  • options (Hash)

    optional parameters.

See Also:



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

def initialize(mode, **options)
  fail ArgumentError unless %i(bind connect).include? mode
  super mode, ZMQ::PAIR, options
end