Пример #1
0
func main() {
	rpcAddr := flag.String("RPCAddr", "", "Address for RPC communication with host application")
	flag.Parse()
	if err := rpc.Register(&Calculator{}); err == nil {
		if p, err := plugins.NewPlugin("calculator (increments by two)", "calcService", &plugins.Options{Address: *rpcAddr}); err == nil {
			p.Serve()
		}
	}
}
Пример #2
0
func ExampleNewPlugin() {
	if p, err := plugins.NewPlugin("calculator", "calcService", &plugins.Options{tcpPort: 5000}); err == nil {
		p.Serve()
	}
}