|
|
| 630 |
TcpSocketImpl::GetSockName (Address &address) const |
630 |
TcpSocketImpl::GetSockName (Address &address) const |
| 631 |
{ |
631 |
{ |
| 632 |
NS_LOG_FUNCTION_NOARGS (); |
632 |
NS_LOG_FUNCTION_NOARGS (); |
| 633 |
address = InetSocketAddress(m_endPoint->GetLocalAddress (), |
633 |
if (m_endPoint != 0) |
| 634 |
m_endPoint->GetLocalPort ()); |
634 |
{ |
|
|
635 |
address = InetSocketAddress (m_endPoint->GetLocalAddress (), |
| 636 |
m_endPoint->GetLocalPort ()); |
| 637 |
} |
| 638 |
else |
| 639 |
{ |
| 640 |
// It is possible to call this method on a socket without a name |
| 641 |
// in which case, behavior is unspecified |
| 642 |
address = InetSocketAddress (Ipv4Address::GetZero (), 0); |
| 643 |
} |
| 635 |
return 0; |
644 |
return 0; |
| 636 |
} |
645 |
} |
| 637 |
|
646 |
|