Connected returns true if the broker is connected and false otherwise. If the broker is not connected but it had tried to connect, the error from that connection attempt is also returned.
()
| 346 | // Connected returns true if the broker is connected and false otherwise. If the broker is not |
| 347 | // connected but it had tried to connect, the error from that connection attempt is also returned. |
| 348 | func (b *Broker) Connected() (bool, error) { |
| 349 | b.lock.Lock() |
| 350 | defer b.lock.Unlock() |
| 351 | |
| 352 | return b.conn != nil, b.connErr |
| 353 | } |
| 354 | |
| 355 | // TLSConnectionState returns the client's TLS connection state. The second return value is false if this is not a tls connection or the connection has not yet been established. |
| 356 | func (b *Broker) TLSConnectionState() (state tls.ConnectionState, ok bool) { |
no outgoing calls