Documentation ¶
Index ¶
- Constants
- func SendUdpMsg(sdl *sch.Scheduler, lsn interface{}, sender interface{}, buf []byte, ...) sch.SchErrno
- type ListenerManager
- type NeighborManager
- func (ngbMgr *NeighborManager) CleanMapReq(name string) NgbMgrErrno
- func (ngbMgr *NeighborManager) FindNodeHandler(findNode *um.FindNode, from *net.UDPAddr) NgbMgrErrno
- func (ngbMgr *NeighborManager) FindNodeReq(findNode *um.FindNode) NgbMgrErrno
- func (ngbMgr *NeighborManager) NeighborsHandler(nbs *um.Neighbors, from *net.UDPAddr) NgbMgrErrno
- func (ngbMgr *NeighborManager) PingHandler(ping *um.Ping, from *net.UDPAddr) NgbMgrErrno
- func (ngbMgr *NeighborManager) PingpongReq(ping *um.Ping) NgbMgrErrno
- func (ngbMgr *NeighborManager) PongHandler(pong *um.Pong, from *net.UDPAddr) NgbMgrErrno
- func (ngbMgr *NeighborManager) PoweroffHandler(ptn interface{}) sch.SchErrno
- func (ngbMgr *NeighborManager) PoweronHandler(ptn interface{}) sch.SchErrno
- func (ngbMgr *NeighborManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno
- func (ngbMgr *NeighborManager) UdpMsgInd(msg *UdpMsgInd) NgbMgrErrno
- type NgbMgrErrno
- type NgbProtoErrno
- type UdpMsgInd
- type UdpReaderTask
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 ¶
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 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
Click to show internal directories.
Click to hide internal directories.