| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| _ "v.io/x/ref/runtime/factories/roaming" |
| ctx, shutdown := v23.Init() |
| server, err := xrpc.NewServer(ctx, "roamer", &dummy{}, nil) |
| ctx.Fatalf("unexpected error: %q", err) |
| watcher := make(chan rpc.NetworkChange, 1) |
| server.WatchNetwork(watcher) |
| status := server.Status() |
| fmt.Printf("Endpoints: %d created:\n", len(status.Endpoints)) |
| for _, ep := range status.Endpoints { |
| fmt.Printf("Mounts: %d mounts:\n", len(status.Mounts)) |
| for _, ms := range status.Mounts { |
| fmt.Printf("Network change: %s", change.DebugString()) |
| func (d *dummy) Echo(call rpc.ServerCall, arg string) (string, error) { |