ing
This commit is contained in:
parent
f854dbf21d
commit
0c7a5e3330
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user