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

Method setLocalAddressAndPort

tools/streamer_recorder/PracticalSocket.cpp:149–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void Socket::setLocalAddressAndPort(const string &localAddress,
150 unsigned short localPort) throw(SocketException) {
151 // Get the address of the requested host
152 sockaddr_in localAddr;
153 fillAddr(localAddress, localPort, localAddr);
154
155 if (bind(sockDesc, (sockaddr *) &localAddr, sizeof(sockaddr_in)) < 0) {
156 throw SocketException("Set of local address and port failed (bind())", true);
157 }
158}
159
160void Socket::cleanUp() throw(SocketException) {
161 #ifdef WIN32

Callers

nothing calls this directly

Calls 2

fillAddrFunction · 0.85
SocketExceptionClass · 0.85

Tested by

no test coverage detected