diff options
Diffstat (limited to 'internal/client/client.go')
| -rw-r--r-- | internal/client/client.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/client/client.go b/internal/client/client.go index f05fcba..0906386 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -15,7 +15,7 @@ func Start(ctx context.Context, conf config.Config, myVoteCh <-chan vote.Vote) { nodeNum := 0 for _, node := range conf.Nodes { - fanOut[nodeNum] = startConnection(ctx, node.Hostname) + fanOut[nodeNum] = startConnection(ctx, node.Address()) nodeNum++ } @@ -46,14 +46,14 @@ func Start(ctx context.Context, conf config.Config, myVoteCh <-chan vote.Vote) { }() } -func startConnection(ctx context.Context, node string) chan vote.Vote { +func startConnection(ctx context.Context, address string) chan vote.Vote { ch := make(chan vote.Vote, 1) go func() { for { - log.Println("client: starting connection", node) - if err := tcpClientRun(ctx, node, ch); err != nil { - log.Println("client: not connected to node", node, "anymore:", err) + log.Println("client: starting connection", address) + if err := tcpClientRun(ctx, address, ch); err != nil { + log.Println("client: not connected to address", address, "anymore:", err) } select { |
