Documentation
¶
Index ¶
- Constants
- func BindProcessorHandler(peer void.Peer, name string, userCallback void.EventHandler, ...)
- func NewEventQueue() void.EventQueue
- func NewProcessor() void.Processor
- func NewQueuedEventCallback(callback void.EventHandler) void.EventHandler
- func QueuedCall(queue void.EventQueue, callback func())
- func Register(name string, f ProcessorBinder)
- func SessionQueuedCall(s void.Session, callback func())
- type ProcessorBinder
- type RecvEvent
- type SendEvent
Constants ¶
View Source
const ( PPRO_TCP_LTV = "tcp.ltv" PPRO_UDP_LTV = "udp.ltv" PPRO_WS_LTV = "ws.ltv" PPRO_HTTP = "http" )
Variables ¶
This section is empty.
Functions ¶
func BindProcessorHandler ¶
func BindProcessorHandler(peer void.Peer, name string, userCallback void.EventHandler, args ...interface{})
func NewEventQueue ¶
func NewEventQueue() void.EventQueue
func NewProcessor ¶
func NewQueuedEventCallback ¶
func NewQueuedEventCallback(callback void.EventHandler) void.EventHandler
让EventCallback保证放在 session 的队列里,而不是并发的
func Register ¶
func Register(name string, f ProcessorBinder)
func SessionQueuedCall ¶
在会话对应的Peer上的事件队列中执行callback,如果没有队列,则马上执行
Types ¶
type ProcessorBinder ¶
type ProcessorBinder func(bundle void.Processor, userCallback void.EventHandler, args ...interface{})
type RecvEvent ¶
type RecvEvent struct {
// contains filtered or unexported fields
}
接受到消息
func NewRecvEvent ¶
type SendEvent ¶
type SendEvent struct {
// contains filtered or unexported fields
}
会话开始发送数据事件
func NewSendEvent ¶
Click to show internal directories.
Click to hide internal directories.