This commit is contained in:
crusader 2017-11-27 20:29:38 +09:00
parent 078c776901
commit dfd14c7fd7
4 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ func New(sh ServerHandler) Server {
s := &server{ s := &server{
sh: sh, sh: sh,
} }
s.ctx = NewServerContext() s.ctx = newServerContext()
return s return s
} }

View File

@ -12,7 +12,7 @@ type serverContext struct {
cuc.Context cuc.Context
} }
func NewServerContext() ServerContext { func newServerContext() ServerContext {
sCTX := &serverContext{} sCTX := &serverContext{}
sCTX.Context = cuc.NewContext(nil) sCTX.Context = cuc.NewContext(nil)

View File

@ -156,7 +156,7 @@ func newSocket(serverCTX ServerContext, id string, conn *websocket.Conn, sh Sock
if 0 < sh.GetReadTimeout() { if 0 < sh.GetReadTimeout() {
s.SetReadDeadline(time.Now().Add(sh.GetReadTimeout() * time.Second)) s.SetReadDeadline(time.Now().Add(sh.GetReadTimeout() * time.Second))
} }
s.ctx = NewSocketContext(serverCTX) s.ctx = newSocketContext(serverCTX)
return s return s
} }

View File

@ -9,7 +9,7 @@ type SocketContext interface {
ServerContext() ServerContext ServerContext() ServerContext
} }
func NewSocketContext(serverCTX ServerContext) SocketContext { func newSocketContext(serverCTX ServerContext) SocketContext {
sCTX := &socketContext{} sCTX := &socketContext{}
sCTX.Context = cuc.NewContext(serverCTX) sCTX.Context = cuc.NewContext(serverCTX)
sCTX.serverCTX = serverCTX sCTX.serverCTX = serverCTX