ing
This commit is contained in:
parent
dfcbc85ce9
commit
8176f88623
12
server.go
12
server.go
@ -7,7 +7,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
channelUtil "git.loafle.net/commons_go/util/channel"
|
||||
uch "git.loafle.net/commons_go/util/channel"
|
||||
"git.loafle.net/overflow/overflow_gateway_websocket/websocket"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
@ -15,7 +15,7 @@ import (
|
||||
type ()
|
||||
|
||||
type socketsChannelAction struct {
|
||||
channelUtil.Action
|
||||
uch.Action
|
||||
s Socket
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ func (s *server) addSocket(soc Socket) {
|
||||
ca := socketsChannelAction{
|
||||
s: soc,
|
||||
}
|
||||
ca.Type = channelUtil.ActionTypeCreate
|
||||
ca.Type = uch.ActionTypeCreate
|
||||
s._socketsCh <- ca
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ func (s *server) removeSocket(soc Socket) {
|
||||
ca := socketsChannelAction{
|
||||
s: soc,
|
||||
}
|
||||
ca.Type = channelUtil.ActionTypeDelete
|
||||
ca.Type = uch.ActionTypeDelete
|
||||
s._socketsCh <- ca
|
||||
}
|
||||
|
||||
@ -115,10 +115,10 @@ func (s *server) listenHandler() {
|
||||
return
|
||||
case ca := <-s._socketsCh:
|
||||
switch ca.Type {
|
||||
case channelUtil.ActionTypeCreate:
|
||||
case uch.ActionTypeCreate:
|
||||
s._sockets[ca.s.ID()] = ca.s
|
||||
break
|
||||
case channelUtil.ActionTypeDelete:
|
||||
case uch.ActionTypeDelete:
|
||||
delete(s._sockets, ca.s.ID())
|
||||
break
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user