ObjectiveLib  1.0.0
Public Member Functions | Static Public Member Functions | Protected Attributes
OLInternetAddress Class Reference

An address in the Internet family of addresses. More...

#import <ObjectiveLib/SocketAddress.h>

Inheritance diagram for OLInternetAddress:
Inheritance graph
[legend]

List of all members.

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
(void) - dealloc
 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.
(void) + 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.

Detailed Description

An address in the Internet family of addresses.

Internet address are suitable for contacting Internet hosts.


Member Function Documentation

Create and return a new address.

The address of the current host is determined and associated with the given port.

Exceptions:
OLSocketExceptionif there is a problem determining the host's address
Parameters:
portthe port that should be associated with the address
Returns:
a reference to the new address

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.

Exceptions:
OLSocketExceptionif there is a problem determining the host's address or if the service cannot be found
Parameters:
servicethe service to look up
Returns:
a reference to the new address
+ (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.

Exceptions:
OLSocketExceptionif the is a problem determining the host's address
Parameters:
namethe name of the host
portthe port that should be associated with the address
Returns:
a reference to the new 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.

Exceptions:
OLSocketExceptionif the is a problem determining the host's address or if the service cannot be found
Parameters:
namethe name of the host
servicethe service to look up
Returns:
a reference to the new address
+ (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.

Parameters:
namethe name of the host to look up
portthe 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.

Parameters:
namethe name of the host to look up
servicethe 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.

Exceptions:
OLSocketExceptionif there is a problem looking up the name
Returns:
the canonical name
- (void) dealloc

Finalize the address and deallocate any allocated memory.

Reimplemented in OLInternet6Address, and OLInternet4Address.

+ (void) 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.

Returns:
YES if this is a wildcard address, NO if not

Reimplemented in OLInternet6Address, and OLInternet4Address.

+ (OLInternetAddress*) loopbackWithPort: (uint16_t)  port

Return the loopback address for this machine associated with the given port.

Parameters:
portthe port to use at the loopback address
Returns:
the address
+ (OLInternetAddress*) loopbackWithService: (const char *)  service

Return the loopback address for this machine associated with the given service.

Parameters:
servicethe service to use at the loopback address
Returns:
the address
- (uint16_t) port

Return the port.

Returns:
the port

Reimplemented in OLInternet6Address, and OLInternet4Address.

Return whether the system prefers to use IPv6 addresses.

Returns:
YES if IPv6 addresses are preferred, NO otherwise
+ (void) setPreferIPv6Addresses: (BOOL)  state

Set whether the system should prefer IPv6 addresses.

Parameters:
stateshould 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.

See also:
- socketType (OLSocket)
Returns:
the type of socket

Member Data Documentation

- (char*) canonicalName [protected]

The canonical name.

- (int) socketType [protected]

The type of socket for which this address is suitable.


The documentation for this class was generated from the following file:

ObjectiveLibGenerated Sat Feb 15 2014 07:45:34, © 2004-2007 Will Mason