Documentation ¶
Index ¶
Constants ¶
View Source
const ( Opening = iota Closed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { Name string Ip string Port int SubscribeBook *SubscribeList //被订阅列表 // contains filtered or unexported fields }
func CreateServer ¶
创建一个UDP服务
func (*Server) RegHandler ¶
func (server *Server) RegHandler(cmdId uint, handler MsgHandler)
设置消息ID对应的回调
type SubscribeList ¶
type SubscribeList struct {
// contains filtered or unexported fields
}
被订阅列表结构
func (*SubscribeList) GetSubscribers ¶
func (sl *SubscribeList) GetSubscribers(infoKey interface{}, del bool) []*net.UDPAddr
获取订阅了key的连接们
func (*SubscribeList) Subscribe ¶
func (sl *SubscribeList) Subscribe(infoKey interface{}, addr *net.UDPAddr)
key被某udp地址所订阅
Click to show internal directories.
Click to hide internal directories.