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

Method getLocalPort

tools/streamer_recorder/PracticalSocket.cpp:126–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126unsigned short Socket::getLocalPort() throw(SocketException) {
127 sockaddr_in addr;
128 unsigned int addr_len = sizeof(addr);
129
130 if (getsockname(sockDesc, (sockaddr *) &addr, (socklen_t *) &addr_len) < 0) {
131 throw SocketException("Fetch of local port failed (getsockname())", true);
132 }
133 return ntohs(addr.sin_port);
134}
135
136void Socket::setLocalPort(unsigned short localPort) throw(SocketException) {
137 // Bind the socket to its port

Callers

nothing calls this directly

Calls 1

SocketExceptionClass · 0.85

Tested by

no test coverage detected