struct NatPMP::MappingPacket

Overview

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

Defined in:

natpmp.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(internal_port : UInt16, external_port : UInt16, op : UInt8 = 1, lifetime : UInt32 = 7200) #

[View source]

Instance Method Detail

def to_io #

Converts the struct instance variables to IO.


[View source]
def 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.


[View source]