udputils

package
v0.0.0-...-4526a9f Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeforeReplyFn

type BeforeReplyFn func(listener *net.UDPConn, srcAddr *net.UDPAddr, outconn *net.UDPConn, b []byte) (replyB []byte, err error)

type BeforeSendFn

type BeforeSendFn func(listener *net.UDPConn, srcAddr *net.UDPAddr, b []byte) (sendB []byte, err error)

type CleanFn

type CleanFn func(srcAddr string)

type CreateOutUDPConnFn

type CreateOutUDPConnFn func(listener *net.UDPConn, srcAddr *net.UDPAddr, packet []byte) (outconn *net.UDPConn, err error)

type IOBinder

type IOBinder struct {
	// contains filtered or unexported fields
}

func NewIOBinder

func NewIOBinder(listener *net.UDPConn, log *logger.Logger) *IOBinder

func (*IOBinder) AfterReadFromClient

func (s *IOBinder) AfterReadFromClient(fn BeforeSendFn) *IOBinder

func (*IOBinder) AfterReadFromServer

func (s *IOBinder) AfterReadFromServer(fn BeforeReplyFn) *IOBinder

func (*IOBinder) AliveWithClientConn

func (s *IOBinder) AliveWithClientConn(srcAddr string, outTCPConn *net.Conn) *IOBinder

func (*IOBinder) AliveWithServeConn

func (s *IOBinder) AliveWithServeConn(srcAddr string, inTCPConn *net.Conn) *IOBinder

func (*IOBinder) Clean

func (s *IOBinder) Clean(fn CleanFn) *IOBinder

func (*IOBinder) Close

func (s *IOBinder) Close()

func (*IOBinder) Factory

func (s *IOBinder) Factory(fn CreateOutUDPConnFn) *IOBinder

func (*IOBinder) Run

func (s *IOBinder) Run() (err error)

func (*IOBinder) Timeout

func (s *IOBinder) Timeout(timeout time.Duration) *IOBinder

Jump to

Keyboard shortcuts

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