diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-02-23 18:45:15 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-02-23 18:45:15 +0100 |
commit | 65e09e831cf13343ac713fbf15281174d1f13a94 (patch) | |
tree | 0176a263ecf6d1059a272007c6f450770f5792ca /lib/xdsserver/webserver.go | |
parent | e97eebc18d726aa55738d7e19513491cf58a6e3a (diff) |
Added target and terminal support.v1.1.0
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver/webserver.go')
-rw-r--r-- | lib/xdsserver/webserver.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/xdsserver/webserver.go b/lib/xdsserver/webserver.go index f1c88d2..24456b9 100644 --- a/lib/xdsserver/webserver.go +++ b/lib/xdsserver/webserver.go @@ -43,8 +43,8 @@ type WebServer struct { const indexFilename = "index.html" -// NewWebServer creates an instance of WebServer -func NewWebServer(ctx *Context) *WebServer { +// WebServerConstructor creates an instance of WebServer +func WebServerConstructor(ctx *Context) *WebServer { // Setup logging for gin router if ctx.Log.Level == logrus.DebugLevel { @@ -183,11 +183,12 @@ func (s *WebServer) socketHandler(c *gin.Context) { } s.sIOServer.On("connection", func(so socketio.Socket) { - s.Log.Debugf("WS Connected (SID=%v)", so.Id()) - s.sessions.UpdateIOSocket(sess.ID, &so) + sessID := sess.ID + s.Log.Debugf("WS Connected (sessID=%v, SID=%v)", sessID, so.Id()) + s.sessions.UpdateIOSocket(sessID, &so) so.On("disconnection", func() { - s.Log.Debugf("WS disconnected (SID=%v)", so.Id()) + s.Log.Debugf("WS disconnected (sessID=%v, SID=%v)", sessID, so.Id()) s.sessions.UpdateIOSocket(sess.ID, nil) }) }) |