ing
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
"git.loafle.net/overflow/overflow_discovery/discovery"
|
||||
"git.loafle.net/overflow/overflow_discovery/rpc/notify"
|
||||
|
||||
crs "git.loafle.net/commons_go/rpc/server"
|
||||
"git.loafle.net/commons_go/server"
|
||||
@@ -43,10 +44,18 @@ func (sh *ServerHandlers) OnConnect(conn net.Conn) (net.Conn, error) {
|
||||
if conn, err = sh.ServerHandlers.OnConnect(conn); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
return newConn(conn, "jsonrpc"), nil
|
||||
nConn := newConn(conn, "jsonrpc")
|
||||
|
||||
notify.NotifyInit(nConn)
|
||||
|
||||
return nConn, nil
|
||||
}
|
||||
|
||||
func (sh *ServerHandlers) Handle(conn net.Conn, stopChan <-chan struct{}, doneChan chan<- struct{}) {
|
||||
defer func() {
|
||||
notify.NotifyDestroy()
|
||||
}()
|
||||
|
||||
dConn := conn.(Conn)
|
||||
contentType := dConn.GetContentType()
|
||||
codec, err := sh.rpcSH.GetCodec(contentType)
|
||||
@@ -74,6 +83,7 @@ func (sh *ServerHandlers) Handle(conn net.Conn, stopChan <-chan struct{}, doneCh
|
||||
}
|
||||
|
||||
func (sh *ServerHandlers) OnStop() {
|
||||
|
||||
discovery.DiscoveryDestroy()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user