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

Method ConnectedServerId

nats.go:2562–2574  ·  view source on GitHub ↗

ConnectedServerId reports the connected server's Id

()

Source from the content-addressed store, hash-verified

2560
2561// ConnectedServerId reports the connected server's Id
2562func (nc *Conn) ConnectedServerId() string {
2563 if nc == nil {
2564 return _EMPTY_
2565 }
2566
2567 nc.mu.RLock()
2568 defer nc.mu.RUnlock()
2569
2570 if nc.status != CONNECTED {
2571 return _EMPTY_
2572 }
2573 return nc.info.ID
2574}
2575
2576// ConnectedServerName reports the connected server's name
2577func (nc *Conn) ConnectedServerName() string {

Callers 1

TestConnectedServerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestConnectedServerFunction · 0.64