diff --git a/README.md b/README.md index 1398c9a28d..fc585b72b8 100644 --- a/README.md +++ b/README.md @@ -228,13 +228,13 @@ communication API over the pipe. // Setup setups app using default pair of pipes func Setup(config *Config) (*App, error) {} -// Accept awaits for incoming loop confirmation request from a Visor and -// returns net.Conn for a received loop. +// Accept awaits for incoming route group confirmation request from a Visor and +// returns net.Conn for a received route group. func (app *App) Accept() (net.Conn, error) {} // Addr implements net.Addr for App connections. &Addr{PubKey: pk, Port: 12} -// Dial sends create loop request to a Visor and returns net.Conn for created loop. +// Dial sends create route group request to a Visor and returns net.Conn for created route group. func (app *App) Dial(raddr *Addr) (net.Conn, error) {} // Close implements io.Closer for App. diff --git a/pkg/app/appnet/skywire_networker.go b/pkg/app/appnet/skywire_networker.go index 4bf78bc5f5..5f33d9b697 100644 --- a/pkg/app/appnet/skywire_networker.go +++ b/pkg/app/appnet/skywire_networker.go @@ -88,8 +88,8 @@ func (r *SkywireNetworker) ListenContext(ctx context.Context, addr Addr) (net.Li if atomic.CompareAndSwapInt32(&r.isServing, 0, 1) { go func() { - if err := r.serveLoop(ctx); err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - r.log.WithError(err).Error("serveLoop stopped unexpectedly.") + if err := r.serveRouteGroup(ctx); err != nil && !strings.Contains(err.Error(), "use of closed network connection") { + r.log.WithError(err).Error("serveRouteGroup stopped unexpectedly.") } }() } @@ -97,9 +97,9 @@ func (r *SkywireNetworker) ListenContext(ctx context.Context, addr Addr) (net.Li return lis, nil } -// serveLoop accepts and serves routes. -func (r *SkywireNetworker) serveLoop(ctx context.Context) error { - log := r.log.WithField("func", "serveLoop") +// serveRouteGroup accepts and serves routes. +func (r *SkywireNetworker) serveRouteGroup(ctx context.Context) error { + log := r.log.WithField("func", "serveRouteGroup") for { log.Debug("Awaiting to accept route group...") diff --git a/pkg/setup/node_test.go b/pkg/setup/node_test.go index 5bc1813491..622bed13e2 100644 --- a/pkg/setup/node_test.go +++ b/pkg/setup/node_test.go @@ -120,7 +120,7 @@ func testDialRouteGroup(t *testing.T, keys []snettest.KeyPair, nEnv *snettest.En } func prepBidirectionalRoute(clients []clientWithDMSGAddrAndListener) routing.BidirectionalRoute { - // prepare loop creation (client_1 will use this to request loop creation with setup node). + // prepare route group creation (client_1 will use this to request a route group creation with setup node). desc := routing.NewRouteDescriptor(clients[1].Addr.PK, clients[4].Addr.PK, 1, 1) forwardHops := []routing.Hop{ diff --git a/pkg/visor/rpc_client.go b/pkg/visor/rpc_client.go index e30eeae4c2..fa0b01984a 100644 --- a/pkg/visor/rpc_client.go +++ b/pkg/visor/rpc_client.go @@ -582,7 +582,7 @@ func (mc *mockRPCClient) RemoveRoutingRule(key routing.RouteID) error { // RouteGroups implements RPCClient. func (mc *mockRPCClient) RouteGroups() ([]RouteGroupInfo, error) { - var loops []RouteGroupInfo + var routeGroups []RouteGroupInfo rules := mc.rt.AllRules() for _, rule := range rules { @@ -595,13 +595,13 @@ func (mc *mockRPCClient) RouteGroups() ([]RouteGroupInfo, error) { if err != nil { return nil, err } - loops = append(loops, RouteGroupInfo{ + routeGroups = append(routeGroups, RouteGroupInfo{ ConsumeRule: rule, FwdRule: fwdRule, }) } - return loops, nil + return routeGroups, nil } // Restart implements RPCClient.