Skip to content

Commit

Permalink
fix(client): check local port before server dial
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed Mar 30, 2023
1 parent 0fe3c30 commit 762fea8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ func NewBoreClient(config Config) BoreClient {

// Run starts the client.
func (c *BoreClient) Run() error {
// Healthcheck
local, err := net.Dial("tcp", c.LocalEndpoint.String())
if err != nil {
return err
}
_ = local.Close()

ch := make(chan os.Signal, 1)
errch := make(chan error)
signal.Notify(ch, os.Interrupt)
Expand Down

0 comments on commit 762fea8

Please sign in to comment.