Documentation ¶
Index ¶
- Variables
- func Relay(sesDetector, payload, passThrough interface{}) error
- func ResoleveInboundEvent(inputEvent cellnet.Event) (ouputEvent cellnet.Event, handled bool, err error)
- func ResolveOutboundEvent(inputEvent cellnet.Event) (handled bool, err error)
- func SetBroadcaster(callback BroadcasterFunc)
- type BroadcasterFunc
- type RecvMsgEvent
- type RelayACK
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRelayPacketCrack = errors.New("invalid relay packet format") ErrUnknownPassThroughKind = errors.New("Unknown PassThrough kind") )
View Source
var (
ErrInvalidPeerSession = errors.New("Require valid cellnet.Session or cellnet.TCPConnector")
)
Functions ¶
func Relay ¶
func Relay(sesDetector, payload, passThrough interface{}) error
sesDetector: 提供要发送到的目标session, 传输msg消息,透传passThroughData
func ResoleveInboundEvent ¶
func ResoleveInboundEvent(inputEvent cellnet.Event) (ouputEvent cellnet.Event, handled bool, err error)
处理入站的relay消息
func ResolveOutboundEvent ¶
处理relay.Relay出站消息的日志
func SetBroadcaster ¶
func SetBroadcaster(callback BroadcasterFunc)
设置广播函数, 回调时,按对应Peer/Session所在的队列中调用
Types ¶
type BroadcasterFunc ¶
type BroadcasterFunc func(event *RecvMsgEvent)
type RecvMsgEvent ¶
func (*RecvMsgEvent) Message ¶
func (self *RecvMsgEvent) Message() interface{}
func (*RecvMsgEvent) PassThroughAsInt64 ¶
func (self *RecvMsgEvent) PassThroughAsInt64() int64
func (*RecvMsgEvent) PassThroughAsInt64Slice ¶
func (self *RecvMsgEvent) PassThroughAsInt64Slice() []int64
func (*RecvMsgEvent) Session ¶
func (self *RecvMsgEvent) Session() cellnet.Session
Click to show internal directories.
Click to hide internal directories.