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

void CommunicatingSocket::connect ( const string &  foreignAddress,
unsigned short  foreignPort 
) throw (SocketException)

Establish a socket connection with the given foreign address and port.

Parameters:
foreignAddress foreign address (IP address or name)
foreignPort foreign port
Exceptions:
SocketException thrown if unable to establish connection

Definition at line 184 of file PracticalSocket.cpp.

References fillAddr().

Referenced by UDPSocket::disconnect().

00185                                                        {
00186   // Get the address of the requested host
00187   sockaddr_in destAddr;
00188   fillAddr(foreignAddress, foreignPort, destAddr);
00189 
00190   // Try to connect to the given port
00191   if (::connect(sockDesc, (sockaddr *) &destAddr, sizeof(destAddr)) < 0) {
00192     throw SocketException("Connect failed (connect())", true);
00193   }
00194 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:13:04 2011 for ImpalaSrc by  doxygen 1.5.1