PSocksSocket Class Reference

#include <socks.h>

Inheritance diagram for PSocksSocket:

PTCPSocket PSocksProtocol PIPSocket PSocket PChannel PObject PSocks4Socket PSocks5Socket List of all members.

Public Member Functions

 PSocksSocket (WORD port=0)
virtual BOOL Connect (const PString &address)
virtual BOOL Connect (const Address &addr)
virtual BOOL Listen (unsigned queueSize=5, WORD port=0, Reusability reuse=AddressIsExclusive)
BOOL Accept ()
virtual BOOL Accept (PSocket &socket)
virtual BOOL GetLocalAddress (Address &addr)
virtual BOOL GetLocalAddress (Address &addr, WORD &port)
virtual BOOL GetPeerAddress (Address &addr)
virtual BOOL GetPeerAddress (Address &addr, WORD &port)

Protected Member Functions

virtual void SetErrorCodes (PChannel::Errors errCode, int osErr)
int TransferHandle (PSocksSocket &destination)

Detailed Description

This is an ancestor class allowing access to a SOCKS servers (version 4 and 5).


Constructor & Destructor Documentation

PSocksSocket::PSocksSocket WORD  port = 0  ) 
 


Member Function Documentation

virtual BOOL PSocksSocket::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.

BOOL PSocksSocket::Accept  ) 
 

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.

A further note is that when the version that uses a parameter is used, the socket parameter is automatically closed and its operating system handle transferred to the current object. This occurs regardless of the return value of the function.

Returns:
TRUE if the channel was successfully opened.

virtual BOOL PSocksSocket::Connect const Address &  addr  )  [virtual]
 

Parameters:
addr  Address of remote machine to connect to.

virtual BOOL PSocksSocket::Connect const PString address  )  [virtual]
 

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 PIPSocket.

virtual BOOL PSocksSocket::GetLocalAddress Address &  addr,
WORD &  port
[virtual]
 

Parameters:
addr  Variable to receive peer hosts IP address
port  Variable to receive peer hosts port number

virtual BOOL PSocksSocket::GetLocalAddress Address &  addr  )  [virtual]
 

Get the Internet Protocol address for the local host.

Returns:
TRUE if the IP number was returned.
Parameters:
addr  Variable to receive hosts IP address

virtual BOOL PSocksSocket::GetPeerAddress Address &  addr,
WORD &  port
[virtual]
 

Parameters:
addr  Variable to receive peer hosts IP address
port  Variable to receive peer hosts port number

virtual BOOL PSocksSocket::GetPeerAddress Address &  addr  )  [virtual]
 

Get the Internet Protocol address for the peer host the socket is connected to.

Returns:
TRUE if the IP number was returned.
Parameters:
addr  Variable to receive hosts IP address

virtual BOOL PSocksSocket::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.

For the UDP protocol, the queueSize parameter is ignored.

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 PTCPSocket.

virtual void PSocksSocket::SetErrorCodes PChannel::Errors  errCode,
int  osErr
[protected, virtual]
 

Implements PSocksProtocol.

int PSocksSocket::TransferHandle PSocksSocket destination  )  [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue Mar 14 16:50:13 2006 for PWLib by  doxygen 1.4.6