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

Method getForeignPort

tools/streamer_recorder/PracticalSocket.cpp:227–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227unsigned short CommunicatingSocket::getForeignPort() throw(SocketException) {
228 sockaddr_in addr;
229 unsigned int addr_len = sizeof(addr);
230
231 if (getpeername(sockDesc, (sockaddr *) &addr, (socklen_t *) &addr_len) < 0) {
232 throw SocketException("Fetch of foreign port failed (getpeername())", true);
233 }
234 return ntohs(addr.sin_port);
235}
236
237// TCPSocket Code
238

Callers

nothing calls this directly

Calls 1

SocketExceptionClass · 0.85

Tested by

no test coverage detected