ConnectedAddr returns the connected server's IP
()
| 2530 | |
| 2531 | // ConnectedAddr returns the connected server's IP |
| 2532 | func (nc *Conn) ConnectedAddr() string { |
| 2533 | if nc == nil { |
| 2534 | return _EMPTY_ |
| 2535 | } |
| 2536 | |
| 2537 | nc.mu.RLock() |
| 2538 | defer nc.mu.RUnlock() |
| 2539 | |
| 2540 | if nc.status != CONNECTED { |
| 2541 | return _EMPTY_ |
| 2542 | } |
| 2543 | return nc.conn.RemoteAddr().String() |
| 2544 | } |
| 2545 | |
| 2546 | // LocalAddr returns the local network address of the connection |
| 2547 | func (nc *Conn) LocalAddr() string { |