neighbor

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LmsNull    = iota // not be inited, configurations are all invalid
	LmsInited         // configurated but not started
	LmsStarted        // in running
	LmsStopped        // stopped, configurations are still validate
)

listener manager task state

View Source
const (
	NgbMgrEnoNone = iota
	NgbMgrEnoParameter
	NgbMgrEnoTimeout
	NgbMgrEnoNotFound
	NgbMgrEnoEncode
	NgbMgrEnoUdp
	NgbMgrEnoDuplicated
	NgbMgrEnoMismatched
	NgbMgrEnoScheduler
)

errno

View Source
const (
	NgbProtoEnoNone = 0

	NgbProtoEnoParameter = iota + 100 // +100, an offset is necessary to distinct this errno from

	NgbProtoEnoScheduler // scheduler
	NgbProtoEnoTimeout   // timeout
	NgbProtoEnoUdp       // udp
)

Protocol handler errno

View Source
const (
	NgbProtoWriteTimeout            = 8 * time.Second  // for underlying sending
	NgbProtoReadTimeout             = 0                // for underlying receiving
	NgbProtoPingResponseTimeout     = 20 * time.Second // for ping
	NgbProtoFindNodeResponseTimeout = 20 * time.Second // for find node
)

Timeouts, zero value would be no timeout

View Source
const LsnMgrName = sch.NgbLsnName

the listener task name

View Source
const (
	NgbMgrName = sch.NgbMgrName // Neighbor manager task name

)
View Source
const (
	NgbProcName = "ngbproto" // Neighbor task name

)

Variables

This section is empty.

Functions

func SendUdpMsg

func SendUdpMsg(sdl *sch.Scheduler, lsn interface{}, sender interface{}, buf []byte, toAddr *net.UDPAddr) sch.SchErrno

Types

type ListenerManager

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

func NewLsnMgr

func NewLsnMgr() *ListenerManager

func (*ListenerManager) TaskProc4Scheduler

func (lsnMgr *ListenerManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno

type NeighborManager

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

Control block of neighbor manager task

func NewNgbMgr

func NewNgbMgr() *NeighborManager

func (*NeighborManager) CleanMapReq

func (ngbMgr *NeighborManager) CleanMapReq(name string) NgbMgrErrno

func (*NeighborManager) FindNodeHandler

func (ngbMgr *NeighborManager) FindNodeHandler(findNode *um.FindNode, from *net.UDPAddr) NgbMgrErrno

func (*NeighborManager) FindNodeReq

func (ngbMgr *NeighborManager) FindNodeReq(findNode *um.FindNode) NgbMgrErrno

func (*NeighborManager) NeighborsHandler

func (ngbMgr *NeighborManager) NeighborsHandler(nbs *um.Neighbors, from *net.UDPAddr) NgbMgrErrno

func (*NeighborManager) PingHandler

func (ngbMgr *NeighborManager) PingHandler(ping *um.Ping, from *net.UDPAddr) NgbMgrErrno

func (*NeighborManager) PingpongReq

func (ngbMgr *NeighborManager) PingpongReq(ping *um.Ping) NgbMgrErrno

func (*NeighborManager) PongHandler

func (ngbMgr *NeighborManager) PongHandler(pong *um.Pong, from *net.UDPAddr) NgbMgrErrno

func (*NeighborManager) PoweroffHandler

func (ngbMgr *NeighborManager) PoweroffHandler(ptn interface{}) sch.SchErrno

func (*NeighborManager) PoweronHandler

func (ngbMgr *NeighborManager) PoweronHandler(ptn interface{}) sch.SchErrno

func (*NeighborManager) TaskProc4Scheduler

func (ngbMgr *NeighborManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno

func (*NeighborManager) UdpMsgInd

func (ngbMgr *NeighborManager) UdpMsgInd(msg *UdpMsgInd) NgbMgrErrno

type NgbMgrErrno

type NgbMgrErrno int

type NgbProtoErrno

type NgbProtoErrno int

type UdpMsgInd

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

type UdpReaderTask

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

func NewUdpReader

func NewUdpReader() *UdpReaderTask

func (*UdpReaderTask) TaskProc4Scheduler

func (udpReader *UdpReaderTask) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno

Jump to

Keyboard shortcuts

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