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

Method sendTo

tools/streamer_recorder/PracticalSocket.cpp:326–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void UDPSocket::sendTo(const void *buffer, int bufferLen,
327 const string &foreignAddress, unsigned short foreignPort)
328 throw(SocketException) {
329 sockaddr_in destAddr;
330 fillAddr(foreignAddress, foreignPort, destAddr);
331
332 // Write out the whole buffer as a single message.
333 if (sendto(sockDesc, (raw_type *) buffer, bufferLen, 0,
334 (sockaddr *) &destAddr, sizeof(destAddr)) != bufferLen) {
335 throw SocketException("Send failed (sendto())", true);
336 }
337}
338
339int UDPSocket::recvFrom(void *buffer, int bufferLen, string &sourceAddress,
340 unsigned short &sourcePort) throw(SocketException) {

Callers 1

streamMethod · 0.80

Calls 2

fillAddrFunction · 0.85
SocketExceptionClass · 0.85

Tested by

no test coverage detected