connection check
This commit is contained in:
parent
ecda63761c
commit
8f967361e8
1 changed files with 7 additions and 1 deletions
|
|
@ -99,7 +99,13 @@ func (c *Client) connectAndSignal(addr string, timeout time.Duration) error {
|
||||||
if res.err != nil {
|
if res.err != nil {
|
||||||
return res.err
|
return res.err
|
||||||
}
|
}
|
||||||
c.connection = res.conn
|
|
||||||
|
c.changeConnection(res.conn)
|
||||||
|
if err := c.init(res.conn); err != nil {
|
||||||
|
res.conn.Close()
|
||||||
|
return fmt.Errorf("init failed: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
close(c.connected)
|
close(c.connected)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue