#include <ipsock.h>
Inheritance diagram for PIPSocket:
PIPSocket::PIPSocket | ( | ) | [protected] |
virtual PString PIPSocket::GetName | ( | ) | const [virtual] |
Get the platform and I/O channel type name of the channel. For an IP socket this returns the host name of the peer the socket is connected to, followed by the socket number it is connected to.
Reimplemented from PChannel.
static int PIPSocket::GetDefaultIpAddressFamily | ( | ) | [static] |
static void PIPSocket::SetDefaultIpAddressFamily | ( | int | ipAdressFamily | ) | [static] |
static void PIPSocket::SetDefaultIpAddressFamilyV4 | ( | ) | [static] |
static PIPSocket::Address PIPSocket::GetDefaultIpAny | ( | ) | [static] |
virtual PBoolean PIPSocket::OpenSocket | ( | int | ipAdressFamily = PF_INET |
) | [pure virtual] |
Implemented in PICMPSocket, PTCPSocket, and PUDPSocket.
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.
address | Address of remote machine to connect to. |
Reimplemented from PSocket.
Reimplemented in PUDPSocket, PSocksSocket, PSocksUDPSocket, and PTelnetSocket.
addr | Address of remote machine to connect to. |
localPort | Local port number for connection |
addr | Address of remote machine to connect to. |
virtual PBoolean PIPSocket::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.
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 PSocket.
Reimplemented in PTCPSocket, PSocksSocket, and PSocksUDPSocket.
virtual PBoolean PIPSocket::Listen | ( | const Address & | bind, | |
unsigned | queueSize = 5 , |
|||
WORD | port = 0 , |
|||
Reusability | reuse = AddressIsExclusive | |||
) | [virtual] |
bind | Local interface address to bind to. |
queueSize | Number of pending accepts that may be queued. |
port | Port number to use for the connection. |
reuse | Can/Can't listen more than once. |
static PString PIPSocket::GetHostName | ( | ) | [static] |
Get the "official" host name for the host specified or if none, the host this process is running on. The host may be specified as an IP number or a hostname alias and is resolved to the canonical form.
hostname | Hosts IP address to get name for |
addr | Hosts IP address to get name for |
Get the Internet Protocol address for the specified host, or if none specified, for the host this process is running on.
addr | Variable to receive hosts IP address |
addr | Variable to receive hosts IP address |
static PStringArray PIPSocket::GetHostAliases | ( | const PString & | hostname | ) | [static] |
Get the alias host names for the specified host. This includes all DNS names, CNAMEs, names in the local hosts file and IP numbers (as "dot" format strings) for the host.
static PStringArray PIPSocket::GetHostAliases | ( | const Address & | addr | ) | [static] |
addr | Hosts IP address |
Determine if the specified host is actually the local machine. This can be any of the host aliases or multi-homed IP numbers or even the special number 127.0.0.1 for the loopback device.
virtual PString PIPSocket::GetLocalAddress | ( | ) | [virtual] |
Get the Internet Protocol address and port for the local host.
addr | Variable to receive hosts IP address |
addr | Variable to receive peer hosts IP address |
port | Variable to receive peer hosts port number |
virtual PString PIPSocket::GetPeerAddress | ( | ) | [virtual] |
Get the Internet Protocol address for the peer host and port the socket is connected to.
addr | Variable to receive hosts IP address |
addr | Variable to receive peer hosts IP address |
port | Variable to receive peer hosts port number |
PString PIPSocket::GetLocalHostName | ( | ) |
Get the host name for the local host.
PString PIPSocket::GetPeerHostName | ( | ) |
Get the host name for the peer host the socket is connected to.
static void PIPSocket::ClearNameCache | ( | ) | [static] |
Clear the name (DNS) cache.
Get the IP address that is being used as the gateway, that is, the computer that packets on the default route will be sent.
The string returned may be used in the Connect() function to open that interface.
Note that the driver does not need to be open for this function to work.
addr | Variable to receive the IP address. |
static PString PIPSocket::GetGatewayInterface | ( | ) | [static] |
Get the name for the interface that is being used as the gateway, that is, the interface that packets on the default route will be sent.
The string returned may be used in the Connect() function to open that interface.
Note that the driver does not need to be open for this function to work.
static PIPSocket::Address PIPSocket::GetRouteInterfaceAddress | ( | PIPSocket::Address | remoteAddress | ) | [static] |
Get the interface address that will be used to reach the specified remote address. Uses longest prefix match when multiple matching interfaces are found.
PIPSocket::PARRAY | ( | RouteTable | , | |
RouteEntry | ||||
) |
static PBoolean PIPSocket::GetRouteTable | ( | RouteTable & | table | ) | [static] |
Get the systems route table.
table | Route table |
static bool PIPSocket::WaitForRouteTableChange | ( | const PTimeInterval & | timeout, | |
PSyncPoint * | cancellation = NULL | |||
) | [static] |
Wait for a change in the route table or network interfaces.
timeout | Timeout for wait |
cancellation | if sync point is signalled, wait is immediately terminated |
PIPSocket::PARRAY | ( | InterfaceTable | , | |
InterfaceEntry | ||||
) |
static PBoolean PIPSocket::GetInterfaceTable | ( | InterfaceTable & | table, | |
PBoolean | includeDown = PFalse | |||
) | [static] |
Get a list of all interfaces
table | interface table |
includeDown | Include interfaces that are down |
static PBoolean PIPSocket::GetNetworkInterface | ( | PIPSocket::Address & | addr | ) | [static] |
Get the address of an interface that corresponds to a real network
PBoolean PIPSocket::SetCaptureReceiveToAddress | ( | ) | [inline] |
Set flag to capture interface address for incoming packets
PIPSocket::Address PIPSocket::GetLastReceiveToAddress | ( | ) | const [inline] |
return the interface address of the last incoming packet