This commit is contained in:
crusader 2018-03-23 01:10:12 +09:00
parent f854dbf21d
commit 0c7a5e3330
2 changed files with 8 additions and 2 deletions

View File

@ -87,6 +87,8 @@ func (sh *GatewayRPCHandlers) Handshake(socketCTX cwf.SocketContext, ctx *fastht
socketCTX.SetAttribute(oogw.ClientTypeKey, oogw.MEMBER) socketCTX.SetAttribute(oogw.ClientTypeKey, oogw.MEMBER)
socketCTX.SetAttribute(oogw.TargetIDKey, userEmail) socketCTX.SetAttribute(oogw.TargetIDKey, userEmail)
logging.Logger().Debugf("Webapp: Client sessionID %s", sessionID)
return sessionID, nil return sessionID, nil
} }

View File

@ -32,14 +32,18 @@ func (sh *SubscriberHandlers) OnSubscribe(channel string, message oos.SubscribeM
} }
for _, soc := range sockets { for _, soc := range sockets {
soc.WriteMessage(websocket.TextMessage, message.Message) if err := soc.WriteMessageUseWriter(websocket.TextMessage, message.Message); nil != err {
logging.Logger().Errorf("OnSubscribe: write error %v", err)
}
} }
} }
case oos.MEMBER_SESSION: case oos.MEMBER_SESSION:
for _, sid := range message.Targets { for _, sid := range message.Targets {
if soc := sh.GetSocket(sid); nil != soc { if soc := sh.GetSocket(sid); nil != soc {
soc.WriteMessage(websocket.TextMessage, message.Message) if err := soc.WriteMessageUseWriter(websocket.TextMessage, message.Message); nil != err {
logging.Logger().Errorf("OnSubscribe: write error %v", err)
}
} }
} }
default: default: