#include <transports.h>
Inheritance diagram for OpalTransportAddress:
Operations | |
enum | BindOptions { NoBinding, HostOnly, FullTSAP, Streamed, Datagram, NumBindOptions } |
BOOL | IsEquivalent (const OpalTransportAddress &address) const |
BOOL | IsCompatible (const OpalTransportAddress &address) const |
BOOL | GetIpAddress (PIPSocket::Address &ip) const |
BOOL | GetIpAndPort (PIPSocket::Address &ip, WORD &port) const |
virtual PString | GetHostName () const |
OpalListener * | CreateListener (OpalEndPoint &endpoint, BindOptions option) const |
virtual OpalTransport * | CreateTransport (OpalEndPoint &endpoint, BindOptions option=HostOnly) const |
Protected Member Functions | |
void | SetInternalTransport (WORD port, const char *proto) |
Protected Attributes | |
OpalInternalTransport * | transport |
OpalTransportAddress::OpalTransportAddress | ( | ) |
OpalTransportAddress::OpalTransportAddress | ( | const char * | address, | |
WORD | port = 0 , |
|||
const char * | proto = NULL | |||
) |
address | Address string to parse |
port | Default port number |
proto | Default is "tcp" |
OpalTransportAddress::OpalTransportAddress | ( | const PString & | address, | |
WORD | port = 0 , |
|||
const char * | proto = NULL | |||
) |
address | Address string to parse |
port | Default port number |
proto | Default is "tcp" |
OpalTransportAddress::OpalTransportAddress | ( | const PIPSocket::Address & | ip, | |
WORD | port, | |||
const char * | proto = NULL | |||
) |
proto | Default is "tcp" |
OpalTransportAddress::OpalTransportAddress | ( | ) |
OpalTransportAddress::OpalTransportAddress | ( | const char * | address, | |
WORD | port = 0 , |
|||
const char * | proto = NULL | |||
) |
address | Address string to parse |
port | Default port number |
proto | Default is "tcp" |
OpalTransportAddress::OpalTransportAddress | ( | const PString & | address, | |
WORD | port = 0 , |
|||
const char * | proto = NULL | |||
) |
address | Address string to parse |
port | Default port number |
proto | Default is "tcp" |
OpalTransportAddress::OpalTransportAddress | ( | const PIPSocket::Address & | ip, | |
WORD | port, | |||
const char * | proto = NULL | |||
) |
proto | Default is "tcp" |
BOOL OpalTransportAddress::IsEquivalent | ( | const OpalTransportAddress & | address | ) | const |
Determine if the two transport addresses are equivalent.
BOOL OpalTransportAddress::IsCompatible | ( | const OpalTransportAddress & | address | ) | const |
Determine if the two transport addresses are compatible.
BOOL OpalTransportAddress::GetIpAddress | ( | PIPSocket::Address & | ip | ) | const |
Extract the ip address from transport address. Returns FALSE, if the address is not an IP transport address.
BOOL OpalTransportAddress::GetIpAndPort | ( | PIPSocket::Address & | ip, | |
WORD & | port | |||
) | const |
Extract the ip address and port number from transport address. Returns FALSE, if the address is not an IP transport address.
virtual PString OpalTransportAddress::GetHostName | ( | ) | const [virtual] |
Translate the transport address to a more human readable form. Returns the hostname if using IP.
OpalListener* OpalTransportAddress::CreateListener | ( | OpalEndPoint & | endpoint, | |
BindOptions | option | |||
) | const |
Create a listener based on this transport address. The BindOptions parameter indicates how the listener is to be created. Note that some transport types may not use this parameter.
With FullTSAP the the full address is used for any local binding, for example, an address of "tcp$10.0.0.1:1720" would create a TCP listening socket that would be bound to the specific interface 10.0.0.1 and listens on port 1720. Note that the address "tcp$*:1720" can be used to bind to INADDR_ANY, and a port number of zero indicates allocate a new random port number.
With HostOnly it would be equivalent to translating the above example to "tcp$10.0.0.1:0" before using it.
Using Streamed or Datagram is similar to HostOnly as only the host part of the address is used, but instead of using the protocol type specifed by the address it guarentees the specifeid type. In the above example Streamed would be identical to HostOnly and Datagram would translate the address to udp$10.0.0.1:0 before using it.
With NoBinding then a compatible listener is created and no local binding is made. This is equivalent to translating the address to "tcp$*:0" so that only the overall protocol type is used.
Also note that if the address has a trailing '+' character then the socket will be bound using the REUSEADDR option, where relevant.
endpoint | Endpoint object for transport creation. |
option | Options for how to create listener |
virtual OpalTransport* OpalTransportAddress::CreateTransport | ( | OpalEndPoint & | endpoint, | |
BindOptions | option = HostOnly | |||
) | const [virtual] |
Create a transport suitable for this address type. The BindOptions parameter indicates how the transport is to be created. Note that some transport types may not use this parameter.
With FullTSAP the the full address is used for any local binding, for example, an address of "tcp$10.0.0.1:1720" would create a TCP transport socket that would be bound to the specific interface 10.0.0.1 and port 1720. Note that the address "tcp$*:1720" can be used to bind to INADDR_ANY, and a port number of zero indicates allocate a new random port number.
With HostOnly it would be equivalent to translating the above example to "tcp$10.0.0.1:0" before using it.
Using Streamed or Datagram is similar to HostOnly as only the host part of the address is used, but instead of using the protocol type specifed by the address it guarentees the specifeid type. In the above example Streamed would be identical to HostOnly and Datagram would translate the address to udp$10.0.0.1:0 before using it.
With NoBinding then a compatible transport is created and no local binding is made. This is equivalent to translating the address to "tcp$*:0" so that only the overall protocol type is used.
Also note that if the address has a trailing '+' character then the socket will be bound using the REUSEADDR option.
endpoint | Endpoint object for transport creation. |
option | Options for how to create transport |
void OpalTransportAddress::SetInternalTransport | ( | WORD | port, | |
const char * | proto | |||
) | [protected] |
port | Default port number |
proto | Default is "tcp" |
OpalInternalTransport* OpalTransportAddress::transport [protected] |