lib/0mq/socket.rb
# Receive a multipart message as routing array and a body array
# All parts before an empty part are considered routing parts,
# and all parta after the empty part are considered body parts.
# The empty delimiter part is not included in the resulting arrays.
Receive a multipart message as routing array and a body array
All parts before an empty part are considered routing parts,
and all parta after the empty part are considered body parts.
The empty delimiter part is not included in the resulting arrays.
Receive a multipart message as routing array and a body array All parts before an empty part are considered routing parts and all parta after the empty part are considered body parts . The empty delimiter part is not included in the resulting arrays .
def recv_with_routing
      [[],[]].tap do |routing, body|
        loop do
          nxt = recv_string
          break if nxt.empty?
          routing << nxt
          raise ArgumentError, "Expected empty routing delimiter in "\
                               "multipart message: #{routing}" \
                                unless get_opt ZMQ::RCVMORE
        end
        loop do
          body << recv_string
          break unless get_opt(ZMQ::RCVMORE)
        end
      end
    end
def recv_with_routing [ [ ] , [ ] ] . tap do | routing , body | loop do nxt = recv_string break if nxt . empty? routing << nxt raise ArgumentError , "Expected empty routing delimiter in " "multipart message: #{routing}" unless get_opt ZMQ :: RCVMORE end loop do body << recv_string break unless get_opt ( ZMQ :: RCVMORE ) end end end
Receive a multipart message as routing array and a body array
All parts before an empty part are considered routing parts,
and all parta after the empty part are considered body parts.
Receive a multipart message as routing array and a body array All parts before an empty part are considered routing parts and all parta after the empty part are considered body parts .