ing
This commit is contained in:
parent
667ba44013
commit
078c776901
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user