class CresIP::Echo

Attributes

header[R]
payload[R]

Public Class Methods

new(header, payload) click to toggle source
# File lib/cresip/echo.rb, line 10
def initialize(header, payload)
    @header = header
    @payload = payload
end

Public Instance Methods

is_response?() click to toggle source
# File lib/cresip/echo.rb, line 21
def is_response?
    @header.type == :echo_response
end
response() click to toggle source
# File lib/cresip/echo.rb, line 25
def response
    head = PacketHeader.new
    head.packet_type = PacketTypes[:echo_response]
    head.packet_size = @payload.length
    Echo.new(head, @payload)
end
to_binary_s() click to toggle source
# File lib/cresip/echo.rb, line 32
def to_binary_s
    "#{@header.to_binary_s}#{@payload}"
end
type() click to toggle source
# File lib/cresip/echo.rb, line 17
def type
    @header.type
end