Skip to content

Commit

Permalink
Merge pull request gruntwork-io#6 from gruntwork-io/v2
Browse files Browse the repository at this point in the history
Close the TCP connection after each attempt.
  • Loading branch information
josh-padnick authored Feb 5, 2018
2 parents f909446 + 46bf1af commit 7d3c2e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ func attemptTcpConnection(port int, opts *options.Options) error {

defaultTimeout := time.Second * 5

_, err := net.DialTimeout("tcp", fmt.Sprintf("0.0.0.0:%d", port), defaultTimeout)
conn, err := net.DialTimeout("tcp", fmt.Sprintf("0.0.0.0:%d", port), defaultTimeout)
if err != nil {
return err
}

defer conn.Close()

return nil
}

Expand Down

0 comments on commit 7d3c2e1

Please sign in to comment.