1 Star 0 Fork 0

yonglinux / rpcx-examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
server.go 522 Bytes
一键复制 编辑 原始数据 按行查看 历史
鸟窝 提交于 2020-05-04 11:03 . move examples to rpcxio/rpcx-examples
package main
import (
"context"
"flag"
example "github.com/rpcxio/rpcx-examples"
"github.com/smallnest/rpcx/server"
)
var (
addr = flag.String("addr", "localhost:8972", "server address")
)
type Echo int
func (*Echo) Say(ctx context.Context, args string, reply *string) error {
*reply = args
return nil
}
func main() {
flag.Parse()
s := server.NewServer()
//s.RegisterName("Arith", new(example.Arith), "")
s.Register(new(example.Arith), "")
s.RegisterName("echo", new(Echo), "")
s.Serve("tcp", *addr)
}
1
https://gitee.com/yonglinux/rpcx-examples.git
git@gitee.com:yonglinux/rpcx-examples.git
yonglinux
rpcx-examples
rpcx-examples
v1.1.6

搜索帮助

53164aa7 5694891 3bd8fe86 5694891