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

Method getForeignAddress

tools/streamer_recorder/PracticalSocket.cpp:216–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216string CommunicatingSocket::getForeignAddress()
217 throw(SocketException) {
218 sockaddr_in addr;
219 unsigned int addr_len = sizeof(addr);
220
221 if (getpeername(sockDesc, (sockaddr *) &addr,(socklen_t *) &addr_len) < 0) {
222 throw SocketException("Fetch of foreign address failed (getpeername())", true);
223 }
224 return inet_ntoa(addr.sin_addr);
225}
226
227unsigned short CommunicatingSocket::getForeignPort() throw(SocketException) {
228 sockaddr_in addr;

Callers

nothing calls this directly

Calls 1

SocketExceptionClass · 0.85

Tested by

no test coverage detected