Class: Pantry::Communication::ReceiveSocket

Inherits:
ReadingSocket show all
Defined in:
lib/pantry/communication/receive_socket.rb

Overview

The ReceiveSocket receives communication from Clients via the Dealer / Router socket pair. This class is the Server’s Router side.

Instance Attribute Summary

Attributes inherited from ReadingSocket

#host, #port

Instance Method Summary collapse

Methods inherited from ReadingSocket

#add_listener, #initialize, #open, #shutdown

Constructor Details

This class inherits a constructor from Pantry::Communication::ReadingSocket

Instance Method Details

#build_socketObject



8
9
10
# File 'lib/pantry/communication/receive_socket.rb', line 8

def build_socket
  Celluloid::ZMQ::RouterSocket.new
end

#has_source_header?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pantry/communication/receive_socket.rb', line 16

def has_source_header?
  true
end

#open_socket(socket) ⇒ Object



12
13
14
# File 'lib/pantry/communication/receive_socket.rb', line 12

def open_socket(socket)
  socket.bind("tcp://#{host}:#{port}")
end