Logo Search packages:      
Sourcecode: pwlib version File versions

BOOL PSPXSocket::Listen ( unsigned  queueSize = 5,
WORD  port = 0,
Reusability  reuse = AddressIsExclusive 
) [virtual]

Listen on a socket for a remote host on the specified port number. This may be used for server based applications. A "connecting" socket begins a connection by initiating a connection to this socket. An active socket of this type is then used to generate other "accepting" sockets which establish a two way communications channel with the "connecting" socket.

If the port# parameter is zero then the port number as defined by the object instance construction or the PIPSocket::SetPort()# function.

Returns:
TRUE if the channel was successfully opened.
Parameters:
queueSize  Number of pending accepts that may be queued.
port  Port number to use for the connection.
reuse  Can/Cant listen more than once.

Reimplemented from PIPXSocket.

Definition at line 1299 of file winsock.cxx.

References PChannel::ConvertOSError(), PIPXSocket::Listen(), and PChannel::os_handle.

{
  if (PIPXSocket::Listen(queueSize, newPort, reuse) &&
      ConvertOSError(::listen(os_handle, queueSize)))
    return TRUE;

  os_close();
  return FALSE;
}


Generated by  Doxygen 1.6.0   Back to index