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

string CommunicatingSocket::getForeignAddress (  )  throw (SocketException)

Get the foreign address.

Call connect() before calling recv()

Returns:
foreign address
Exceptions:
SocketException thrown if unable to fetch foreign address

Definition at line 217 of file PracticalSocket.cpp.

References Socket::sockDesc.

00218                            {
00219   sockaddr_in addr;
00220   unsigned int addr_len = sizeof(addr);
00221 
00222   if (getpeername(sockDesc, (sockaddr *) &addr,(socklen_t *) &addr_len) < 0) {
00223     throw SocketException("Fetch of foreign address failed (getpeername())", true);
00224   }
00225   return inet_ntoa(addr.sin_addr);
00226 }


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