From 0c7a5e33301d2fcd6a268fdbb00a108848e85019 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 23 Mar 2018 01:10:12 +0900 Subject: [PATCH] ing --- servlet/webapp/gateway_rpc_handlers.go | 2 ++ servlet/webapp/subscriber_handlers.go | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/servlet/webapp/gateway_rpc_handlers.go b/servlet/webapp/gateway_rpc_handlers.go index 2759109..9527ed1 100644 --- a/servlet/webapp/gateway_rpc_handlers.go +++ b/servlet/webapp/gateway_rpc_handlers.go @@ -87,6 +87,8 @@ func (sh *GatewayRPCHandlers) Handshake(socketCTX cwf.SocketContext, ctx *fastht socketCTX.SetAttribute(oogw.ClientTypeKey, oogw.MEMBER) socketCTX.SetAttribute(oogw.TargetIDKey, userEmail) + logging.Logger().Debugf("Webapp: Client sessionID %s", sessionID) + return sessionID, nil } diff --git a/servlet/webapp/subscriber_handlers.go b/servlet/webapp/subscriber_handlers.go index 3258dce..9ff6d10 100644 --- a/servlet/webapp/subscriber_handlers.go +++ b/servlet/webapp/subscriber_handlers.go @@ -32,14 +32,18 @@ func (sh *SubscriberHandlers) OnSubscribe(channel string, message oos.SubscribeM } 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: for _, sid := range message.Targets { 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: