Contains common parts of MessageSend and MessageResult
Creates the appropriate message instance from the next packet
which was captured by drbdump
on the given
stream
.
# File lib/drbdump/message.rb, line 10 def self.from_stream drbdump, packet, stream loader = drbdump.loader first_chunk = loader.load stream case first_chunk.load when nil, Integer then DRbDump::MessageSend.new drbdump, packet, first_chunk, stream when true, false then DRbDump::MessageResult.new drbdump, packet, first_chunk, stream end end
Initializes a message from packet
captured by a
drbdump
# File lib/drbdump/message.rb, line 26 def initialize drbdump, packet @drbdump = drbdump @loader = drbdump.loader @packet = packet @statistics = drbdump.statistics @source = nil @destination = nil end
The resolved destination for the message.
# File lib/drbdump/message.rb, line 39 def destination return @destination if @destination resolve_addresses @destination end
The resolved source of the message
# File lib/drbdump/message.rb, line 63 def source return @source if @source resolve_addresses @source end