IsConnected tests if a Conn is connected.
()
| 6067 | |
| 6068 | // IsConnected tests if a Conn is connected. |
| 6069 | func (nc *Conn) IsConnected() bool { |
| 6070 | nc.mu.RLock() |
| 6071 | defer nc.mu.RUnlock() |
| 6072 | return nc.isConnected() |
| 6073 | } |
| 6074 | |
| 6075 | // drainConnection will run in a separate Go routine and will |
| 6076 | // flush all publishes and drain all active subscriptions. |