From 4eaa31788d9680be3dcd216a4a5726b8c8c09cba Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 27 Nov 2017 20:35:39 +0900 Subject: [PATCH] ing --- server.go | 2 +- server_context.go | 4 ++-- socket.go | 2 +- socket_context.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index 346cd08..70894c5 100644 --- a/server.go +++ b/server.go @@ -23,7 +23,7 @@ func New(sh ServerHandler) Server { s := &server{ sh: sh, } - s.ctx = newServerContext() + s.ctx = NewServerContext(nil) return s } diff --git a/server_context.go b/server_context.go index 8c66fcc..0305dd1 100644 --- a/server_context.go +++ b/server_context.go @@ -12,9 +12,9 @@ type serverContext struct { cuc.Context } -func newServerContext() ServerContext { +func NewServerContext(parent cuc.Context) ServerContext { sCTX := &serverContext{} - sCTX.Context = cuc.NewContext(nil) + sCTX.Context = cuc.NewContext(parent) return sCTX } diff --git a/socket.go b/socket.go index eedfcc4..5b6aa83 100644 --- a/socket.go +++ b/socket.go @@ -156,7 +156,7 @@ func newSocket(serverCTX ServerContext, id string, conn *websocket.Conn, sh Sock if 0 < sh.GetReadTimeout() { s.SetReadDeadline(time.Now().Add(sh.GetReadTimeout() * time.Second)) } - s.ctx = newSocketContext(serverCTX) + s.ctx = NewSocketContext(serverCTX) return s } diff --git a/socket_context.go b/socket_context.go index f0b32ab..fe997a3 100644 --- a/socket_context.go +++ b/socket_context.go @@ -9,7 +9,7 @@ type SocketContext interface { ServerContext() ServerContext } -func newSocketContext(serverCTX ServerContext) SocketContext { +func NewSocketContext(serverCTX ServerContext) SocketContext { sCTX := &socketContext{} sCTX.Context = cuc.NewContext(serverCTX) sCTX.serverCTX = serverCTX