| 337 | } |
| 338 | |
| 339 | int UDPSocket::recvFrom(void *buffer, int bufferLen, string &sourceAddress, |
| 340 | unsigned short &sourcePort) throw(SocketException) { |
| 341 | sockaddr_in clntAddr; |
| 342 | socklen_t addrLen = sizeof(clntAddr); |
| 343 | int rtn; |
| 344 | if ((rtn = recvfrom(sockDesc, (raw_type *) buffer, bufferLen, 0, |
| 345 | (sockaddr *) &clntAddr, (socklen_t *) &addrLen)) < 0) { |
| 346 | throw SocketException("Receive failed (recvfrom())", true); |
| 347 | } |
| 348 | sourceAddress = inet_ntoa(clntAddr.sin_addr); |
| 349 | sourcePort = ntohs(clntAddr.sin_port); |
| 350 | |
| 351 | return rtn; |
| 352 | } |
| 353 | |
| 354 | void UDPSocket::setMulticastTTL(unsigned char multicastTTL) throw(SocketException) { |
| 355 | if (setsockopt(sockDesc, IPPROTO_IP, IP_MULTICAST_TTL, |
nothing calls this directly
no test coverage detected