MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / recvFrom

Method recvFrom

tools/streamer_recorder/PracticalSocket.cpp:339–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339int 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
354void UDPSocket::setMulticastTTL(unsigned char multicastTTL) throw(SocketException) {
355 if (setsockopt(sockDesc, IPPROTO_IP, IP_MULTICAST_TTL,

Callers

nothing calls this directly

Calls 1

SocketExceptionClass · 0.85

Tested by

no test coverage detected