overflow_probe_container/server/server.go

20 lines
448 B
Go
Raw Normal View History

2017-12-05 05:20:42 +00:00
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, rpcInvoker crr.RPCInvoker) server.Server {
rpcSH := newRPCServletHandler(rpcInvoker)
rpcSH.RegisterCodec(crpj.Name, crpj.NewServerCodec())
socketHandler := newSocketHandler(rpcSH)
sh := newServerHandler(addr, socketHandler)
s := server.New(sh)
return s
}