struct

NatPMP::MappingPacket

Inherits Struct < Value < Object

You can use this struct to craft your own mapping packets in case you want to handle it all by yourself.

# This creates a mapping that you can use to send trough a Socket
packet_io = NatPMP::MappingPacket.new(25565, 25565, 1, 3600).to_io
packet_slice = NatPMP::MappingPacket.new(25565, 25565, 1, 3600).to_slice

Constructors

new(internal_port : UInt16, external_port : UInt16, op : UInt8 = 1, lifetime : UInt32 = 7200)
Source

Instance methods

to_io

Converts the struct instance variables to IO.

Source
to_slice

Converts the struct instance variables to an StaticArray.

Side Note: This is not actually a Slice, it's an StaticArray so I don't think this member function should be called like this.

Source