ing
This commit is contained in:
parent
87b8c60cd9
commit
9c67878002
|
@ -6,13 +6,13 @@ import (
|
||||||
"git.loafle.net/commons_go/server"
|
"git.loafle.net/commons_go/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
func New(addr string, rpcInvoker crr.RPCInvoker) server.Server {
|
func New(addr string, serverName string, rpcInvoker crr.RPCInvoker) server.Server {
|
||||||
rpcSH := newRPCServletHandler(rpcInvoker)
|
rpcSH := newRPCServletHandler(rpcInvoker)
|
||||||
rpcSH.RegisterCodec(crpj.Name, crpj.NewServerCodec())
|
rpcSH.RegisterCodec(crpj.Name, crpj.NewServerCodec())
|
||||||
|
|
||||||
socketHandler := newSocketHandler(rpcSH)
|
socketHandler := newSocketHandler(rpcSH)
|
||||||
|
|
||||||
sh := newServerHandler(addr, socketHandler)
|
sh := newServerHandler(addr, serverName, socketHandler)
|
||||||
s := server.New(sh)
|
s := server.New(sh)
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
|
@ -4,16 +4,15 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.loafle.net/commons_go/logging"
|
"git.loafle.net/commons_go/logging"
|
||||||
|
|
||||||
"git.loafle.net/commons_go/server"
|
"git.loafle.net/commons_go/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newServerHandler(addr string, socketHandler SocketHandler) ServerHandler {
|
func newServerHandler(addr string, serverName string, socketHandler SocketHandler) ServerHandler {
|
||||||
sh := &ServerHandlers{
|
sh := &ServerHandlers{
|
||||||
addr: addr,
|
addr: addr,
|
||||||
}
|
}
|
||||||
|
|
||||||
sh.Name = "Network Container"
|
sh.Name = serverName
|
||||||
sh.SocketHandler = socketHandler
|
sh.SocketHandler = socketHandler
|
||||||
return sh
|
return sh
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user