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

BOOL PSPXSocket::Accept ( PSocket socket  )  [virtual]

Open a socket to a remote host on the specified port number. This is an "accepting" socket. When a "listening" socket has a pending connection to make, this will accept a connection made by the "connecting" socket created to establish a link.

The port that the socket uses is the one used in the Listen()# command of the socket# parameter.

Note that this function will block until a remote system connects to the port number specified in the "listening" socket.

Returns:
TRUE if the channel was successfully opened.
Parameters:
socket  Listening socket making the connection.

Reimplemented from PSocket.

Definition at line 1310 of file winsock.cxx.

References PSocket::port.

{
  PAssert(PIsDescendant(&socket, PIPXSocket), "Invalid listener socket");

  sockaddr_ipx sip;
  sip.sa_family = AF_IPX;
  int size = sizeof(sip);
  if (!os_accept(socket, (struct sockaddr *)&sip, &size))
    return FALSE;

  port = ((PIPXSocket &)socket).GetPort();
  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index