overflow_probe_container/server/server.go
crusader 9c67878002 ing
2017-12-05 14:27:56 +09:00

20 lines
479 B
Go

package server
import (
crpj "git.loafle.net/commons_go/rpc/protocol/json"
crr "git.loafle.net/commons_go/rpc/registry"
"git.loafle.net/commons_go/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, serverName, socketHandler)
s := server.New(sh)
return s
}