MCPcopy
hub / github.com/nats-io/nats.go / IsConnected

Method IsConnected

nats.go:6069–6073  ·  view source on GitHub ↗

IsConnected tests if a Conn is connected.

()

Source from the content-addressed store, hash-verified

6067
6068// IsConnected tests if a Conn is connected.
6069func (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.

Calls 1

isConnectedMethod · 0.95