()
| 158 | } |
| 159 | |
| 160 | func (b *Broker) getSockError() error { |
| 161 | // skip socket health checks while another operation owns broker state |
| 162 | if !b.lock.TryLock() { |
| 163 | return nil |
| 164 | } |
| 165 | defer b.lock.Unlock() |
| 166 | |
| 167 | if b.conn == nil { |
| 168 | return nil |
| 169 | } |
| 170 | |
| 171 | conn := b.conn |
| 172 | if c, ok := conn.(*bufConn); ok { |
| 173 | conn = c.Conn |
| 174 | } |
| 175 | if c, ok := conn.(*tls.Conn); ok { |
| 176 | conn = c.NetConn() |
| 177 | } |
| 178 | if c, ok := conn.(*net.TCPConn); ok { |
| 179 | return getTCPConnSockError(c) |
| 180 | } |
| 181 | return nil |
| 182 | } |
| 183 | |
| 184 | // Open tries to connect to the Broker if it is not already connected or connecting, but does not block |
| 185 | // waiting for the connection to complete. This means that any subsequent operations on the broker will |
no test coverage detected