LocalAddr returns the local network address of the connection
()
| 2545 | |
| 2546 | // LocalAddr returns the local network address of the connection |
| 2547 | func (nc *Conn) LocalAddr() string { |
| 2548 | if nc == nil { |
| 2549 | return _EMPTY_ |
| 2550 | } |
| 2551 | |
| 2552 | nc.mu.RLock() |
| 2553 | defer nc.mu.RUnlock() |
| 2554 | |
| 2555 | if nc.status != CONNECTED { |
| 2556 | return _EMPTY_ |
| 2557 | } |
| 2558 | return nc.conn.LocalAddr().String() |
| 2559 | } |
| 2560 | |
| 2561 | // ConnectedServerId reports the connected server's Id |
| 2562 | func (nc *Conn) ConnectedServerId() string { |