Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Socket::setLocalAddressAndPort ( const string &  localAddress,
unsigned short  localPort = 0 
) throw (SocketException)

Set the local port to the specified port and the local address to the specified address.

If you omit the port, a random port will be selected.

Parameters:
localAddress local address
localPort local port
Exceptions:
SocketException thrown if setting local port or address fails

Definition at line 146 of file PracticalSocket.cpp.

References fillAddr().

00147                                                      {
00148   // Get the address of the requested host
00149   sockaddr_in localAddr;
00150   fillAddr(localAddress, localPort, localAddr);
00151 
00152   if (bind(sockDesc, (sockaddr *) &localAddr, sizeof(sockaddr_in)) < 0) {
00153     throw SocketException("Set of local address and port failed (bind())", true);
00154   }
00155 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:32:31 2010 for ImpalaSrc by  doxygen 1.5.1