| 225 | } |
| 226 | |
| 227 | unsigned short CommunicatingSocket::getForeignPort() throw(SocketException) { |
| 228 | sockaddr_in addr; |
| 229 | unsigned int addr_len = sizeof(addr); |
| 230 | |
| 231 | if (getpeername(sockDesc, (sockaddr *) &addr, (socklen_t *) &addr_len) < 0) { |
| 232 | throw SocketException("Fetch of foreign port failed (getpeername())", true); |
| 233 | } |
| 234 | return ntohs(addr.sin_port); |
| 235 | } |
| 236 | |
| 237 | // TCPSocket Code |
| 238 |
nothing calls this directly
no test coverage detected