Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kifen committed Mar 6, 2020
1 parent 3785b02 commit e8fd8cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions pkg/app/appnet/skywire_networker.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ 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.")
}
}()
}

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...")
Expand Down
2 changes: 1 addition & 1 deletion pkg/setup/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
6 changes: 3 additions & 3 deletions pkg/visor/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.
Expand Down

0 comments on commit e8fd8cc

Please sign in to comment.