Method: AvroMachine::Connection#receive_data

Defined in:
lib/avro_machine/connection.rb

#receive_data(data) ⇒ Object

buffer data - we can receive incomplete request over the tcp port



16
17
18
19
20
21
22
23
# File 'lib/avro_machine/connection.rb', line 16

def receive_data(data)
  @input << data

  # an avro request is terminated by a 0 byte
  return unless @input[-4..-1].unpack('N')[0] == 0

  handle_avro(@input)
end