Packets can be sent/received now

This commit is contained in:
2020-05-10 20:30:22 -05:00
parent a0f8ce4bfb
commit 644c1916b2
4 changed files with 47 additions and 15 deletions

View File

@@ -10,12 +10,14 @@ class IMICFPS
end
def reconstruct_packets
packets = []
pairs = []
@buffer.each do |buffer, addr_info|
@buffer.each do |hash|
buffer, addr = hash[:buffer], hash[:addr_info]
packet = Packet.from_stream(buffer)
if packet.valid?
if true#packet.valid?
pairs << [packet, addr]
@buffer.delete(buffer)
else
puts "Invalid packet: #{packet}"
@@ -23,7 +25,7 @@ class IMICFPS
end
end
return packets
return pairs
end
end
end