This commit is contained in:
crusader 2017-09-27 17:41:01 +09:00
parent aac31c8218
commit 83c0e4d252
2 changed files with 12 additions and 12 deletions

View File

@ -21,10 +21,10 @@ type authSubscriberHandlers struct {
ctx context.Context
}
func (h *authSubscriberHandlers) OnSubscribe(payload string) {
uid := "kdkdkd"
channel := "auth"
soc := server.GetSocket(channel, uid)
soc.Write([]byte(payload))
func (h *authSubscriberHandlers) OnSubscribe(channel string, message ofs.SubscribeMessage) {
for _, uid := range message.Targets {
if soc := server.GetSocket(channel, uid); nil != soc {
soc.Write(message.Message)
}
}
}

View File

@ -21,10 +21,10 @@ type probeSubscriberHandlers struct {
ctx context.Context
}
func (h *probeSubscriberHandlers) OnSubscribe(payload string) {
uid := "kdkdkd"
channel := "auth"
soc := server.GetSocket(channel, uid)
soc.Write([]byte(payload))
func (h *probeSubscriberHandlers) OnSubscribe(channel string, message ofs.SubscribeMessage) {
for _, uid := range message.Targets {
if soc := server.GetSocket(channel, uid); nil != soc {
soc.Write(message.Message)
}
}
}