Skip to content

Commit

Permalink
close TCP connections
Browse files Browse the repository at this point in the history
  • Loading branch information
myles-mcdonnell committed Jun 8, 2018
1 parent 5906447 commit 09b81b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ tests:
go test ./...

system_test: build
go test -tags cli_tests ./cli_tests
go test -tags cli_tests ./cli_tests
5 changes: 4 additions & 1 deletion blondie.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ func (check *httpCheck) Try() bool {

func (check *tcpCheck) Try() bool {
address := fmt.Sprintf("%s:%v", check.host, check.port)
_, err := check.dial("tcp", address, check.timeout)
conn, err := check.dial("tcp", address, check.timeout)
if conn != nil {
conn.Close()
}
return err == nil
}

Expand Down

0 comments on commit 09b81b9

Please sign in to comment.