This commit is contained in:
crusader 2017-12-05 14:27:56 +09:00
parent 87b8c60cd9
commit 9c67878002
2 changed files with 4 additions and 5 deletions

View File

@ -6,13 +6,13 @@ import (
"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.RegisterCodec(crpj.Name, crpj.NewServerCodec())
socketHandler := newSocketHandler(rpcSH)
sh := newServerHandler(addr, socketHandler)
sh := newServerHandler(addr, serverName, socketHandler)
s := server.New(sh)
return s

View File

@ -4,16 +4,15 @@ import (
"fmt"
"git.loafle.net/commons_go/logging"
"git.loafle.net/commons_go/server"
)
func newServerHandler(addr string, socketHandler SocketHandler) ServerHandler {
func newServerHandler(addr string, serverName string, socketHandler SocketHandler) ServerHandler {
sh := &ServerHandlers{
addr: addr,
}
sh.Name = "Network Container"
sh.Name = serverName
sh.SocketHandler = socketHandler
return sh
}