| 147 | } |
| 148 | |
| 149 | void Socket::setLocalAddressAndPort(const string &localAddress, |
| 150 | unsigned short localPort) throw(SocketException) { |
| 151 | // Get the address of the requested host |
| 152 | sockaddr_in localAddr; |
| 153 | fillAddr(localAddress, localPort, localAddr); |
| 154 | |
| 155 | if (bind(sockDesc, (sockaddr *) &localAddr, sizeof(sockaddr_in)) < 0) { |
| 156 | throw SocketException("Set of local address and port failed (bind())", true); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void Socket::cleanUp() throw(SocketException) { |
| 161 | #ifdef WIN32 |
nothing calls this directly
no test coverage detected