#import <ObjectiveLib/SocketAddress.h>
Inheritance diagram for OLInternetAddress:
Public Member Functions | |
(const char *) | - canonicalName |
Return the canonical name of the host. | |
(BOOL) | - isLocalWildcard |
Return whether this address is a local wildcard. | |
(uint16_t) | - port |
Return the port. | |
(int) | - socketType |
Return the type of socket with which this address may be used. | |
Initializers and Deallocators | |
(id) | - free |
Finalize the address and deallocate any allocated memory. | |
Static Public Member Functions | |
(OLInternetAddress *) | + addressWithCurrentHostAndPort: |
Create and return a new address. | |
(OLInternetAddress *) | + addressWithCurrentHostAndService: |
Create and return a new address. | |
(OLInternetAddress *) | + addressWithHost:port: |
Create and return a new address. | |
(OLInternetAddress *) | + addressWithHost:service: |
Create and return a new address. | |
(OLVector *) | + allAddressesWithHost:port: |
Return all addresses available from the given port of the given host. | |
(OLVector *) | + allAddressesWithHost:service: |
Return all addresses available from the given service of the given host. | |
(id) | + initialize |
Initialize the class when it is loaded into the runtime system. | |
(OLInternetAddress *) | + loopbackWithPort: |
Return the loopback address for this machine associated with the given port. | |
(OLInternetAddress *) | + loopbackWithService: |
Return the loopback address for this machine associated with the given service. | |
(BOOL) | + preferIPv6Addresses |
Return whether the system prefers to use IPv6 addresses. | |
(void) | + setPreferIPv6Addresses: |
Set whether the system should prefer IPv6 addresses. | |
Protected Attributes | |
char * | canonicalName |
The canonical name. | |
int | socketType |
The type of socket for which this address is suitable. |
Internet address are suitable for contacting Internet hosts.
+ (OLInternetAddress*) addressWithCurrentHostAndPort: | (uint16_t) | port |
Create and return a new address.
The address of the current host is determined and associated with the given port.
OLSocketException | if there is a problem determining the host's address |
port | the port that should be associated with the address |
+ (OLInternetAddress*) addressWithCurrentHostAndService: | (const char *) | service |
Create and return a new address.
The address of the current host is determined and associated with the given service. Service names are those enumerated (usually) in the /etc/services file. The service entry corresponding to the requested service is retrieved and its port is associated with the new address.
OLSocketException | if there is a problem determining the host's address or if the service cannot be found |
service | the service to look up |
+ (OLInternetAddress*) addressWithHost: | (const char *) | name | ||
port: | (uint16_t) | port | ||
Create and return a new address.
The address of the named host is looked up and associated with the given port.
OLSocketException | if the is a problem determining the host's address |
name | the name of the host | |
port | the port that should be associated with the address |
+ (OLInternetAddress*) addressWithHost: | (const char *) | name | ||
service: | (const char *) | service | ||
Create and return a new address.
The address of the named host is determined and associated with the given service. Service names are those enumerated (usually) in the /etc/services file. The service entry corresponding to the requested service is retrieved and its port is associated with the new address.
OLSocketException | if the is a problem determining the host's address or if the service cannot be found |
name | the name of the host | |
service | the service to look up |
+ (OLVector*) allAddressesWithHost: | (const char *) | name | ||
port: | (uint16_t) | port | ||
Return all addresses available from the given port of the given host.
The vector will contain objects of type OLInternetAddress.
name | the name of the host to look up | |
port | the port number of the desired host |
+ (OLVector*) allAddressesWithHost: | (const char *) | name | ||
service: | (const char *) | service | ||
Return all addresses available from the given service of the given host.
The vector will contain objects of type OLInternetAddress.
name | the name of the host to look up | |
service | the name of the service to look up |
- (const char*) canonicalName |
Return the canonical name of the host.
The host to which this address points is looked up to determine its name. The name is returned.
OLSocketException | if there is a problem looking up the name |
- (id) free |
Finalize the address and deallocate any allocated memory.
Reimplemented in OLInternet4Address, and OLInternet6Address.
+ (id) initialize |
Initialize the class when it is loaded into the runtime system.
Please don't call this method.
- (BOOL) isLocalWildcard |
Return whether this address is a local wildcard.
A local wildcard address is one that can refer to any of the current host's IP addresses without specifying exactly which one.
Reimplemented in OLInternet4Address, and OLInternet6Address.
+ (OLInternetAddress*) loopbackWithPort: | (uint16_t) | port |
Return the loopback address for this machine associated with the given port.
port | the port to use at the loopback address |
+ (OLInternetAddress*) loopbackWithService: | (const char *) | service |
Return the loopback address for this machine associated with the given service.
service | the service to use at the loopback address |
- (uint16_t) port |
+ (BOOL) preferIPv6Addresses |
Return whether the system prefers to use IPv6 addresses.
+ (void) setPreferIPv6Addresses: | (BOOL) | state |
Set whether the system should prefer IPv6 addresses.
state | should be YES if IPv6 addresses are preferred, NO otherwise |
- (int) socketType |
Return the type of socket with which this address may be used.
This value is a platform-dependent number that will correspond to a defined value such as SOCK_STREAM or SOCK_DGRAM.
- (char*) canonicalName [protected] |
The canonical name.
- (int) socketType [protected] |
The type of socket for which this address is suitable.
|