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

BOOL PTelnetSocket::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 PTCPSocket.

Definition at line 135 of file telnet.cxx.

References PTCPSocket::Accept(), SendDo(), SendWill(), StatusOption, and SuppressGoAhead.

{
  if (!PTCPSocket::Accept(sock))
    return FALSE;

  SendDo(SuppressGoAhead);
  SendWill(StatusOption);
  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index