protocal

package
v0.0.0-...-9682c69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUDPPacketSize = 4096
View Source
const Timeout = time.Second * 30

Variables

This section is empty.

Functions

func ClientSide

func ClientSide(nat *NAT, pconn net.PacketConn) error

func ServerSide

func ServerSide(accept func() (net.Conn, error), target net.Addr) error

Types

type NAT

type NAT struct {
	ChannelSize int
	Dial        func() (net.Conn, error) // Just modify before use it
	// contains filtered or unexported fields
}

func NewNAT

func NewNAT() *NAT

func (*NAT) Get

func (nat *NAT) Get(from net.Addr) net.Conn

func (*NAT) Remove

func (nat *NAT) Remove(addr net.Addr)

func (*NAT) Send

func (nat *NAT) Send(from net.Addr, data []byte) error

func (*NAT) Setup

func (nat *NAT) Setup(from net.Addr) (ok bool, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL