Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PIPSocket::Connect ( const PString address  )  [virtual, inherited]

Connect a socket to a remote host on the specified port number. This is typically used by the client or initiator of a communications channel. This connects to a "listening" socket at the other end of the communications channel.

The port number as defined by the object instance construction or the PIPSocket::SetPort()# function.

Returns:
TRUE if the channel was successfully connected to the remote host.
Parameters:
address  Address of remote machine to connect to.

Reimplemented from PSocket.

Reimplemented in PSocksSocket, PSocksUDPSocket, PTelnetSocket, and PUDPSocket.

Definition at line 1941 of file sockets.cxx.

References PIPSocket::GetHostAddress().

Referenced by PIPSocket::Connect(), PTelnetSocket::Connect(), and PInternetProtocol::Connect().

{
  Address ipnum;
#if P_HAS_IPV6
  if (GetHostAddress(host, ipnum))
    return Connect(GetDefaultIpAny(), 0, ipnum);
#else
  if (GetHostAddress(host, ipnum))
    return Connect(INADDR_ANY, 0, ipnum);
#endif  
  return FALSE;
}


Generated by  Doxygen 1.6.0   Back to index