| 214 | } |
| 215 | |
| 216 | string CommunicatingSocket::getForeignAddress() |
| 217 | throw(SocketException) { |
| 218 | sockaddr_in addr; |
| 219 | unsigned int addr_len = sizeof(addr); |
| 220 | |
| 221 | if (getpeername(sockDesc, (sockaddr *) &addr,(socklen_t *) &addr_len) < 0) { |
| 222 | throw SocketException("Fetch of foreign address failed (getpeername())", true); |
| 223 | } |
| 224 | return inet_ntoa(addr.sin_addr); |
| 225 | } |
| 226 | |
| 227 | unsigned short CommunicatingSocket::getForeignPort() throw(SocketException) { |
| 228 | sockaddr_in addr; |
nothing calls this directly
no test coverage detected