10.11. File too/inet

class too.InetAddress

An InetAddress really is an IPv4 address. It depends on the underlying IPv6 implementation if this class is usable for IPv6 addresses.

inherits

State supers: State, Address

methods


instance (id)
  with (InetHost, pointer, int) (h, a, l);

Return a new instance with the indicated fields. (The address will be deallocated upon the death of the newly created address.)

instance too.InetAddress

variables

InetHost host;

The host on which this address resides.

pointer address;

The internet address.

int address_length;

The length in bytes of the address.

methods


(pointer, int)
  osAddress;

Return the low-level bare address.


void
  dealloc;

Undocumented.


boolean
  equal id other;

Undocumented.


int
  hash;

Undocumented.


InetHost
  host;

Return the host of this address. The host is looked up if the address was not yet related to a host.


protected id
  init (InetHost, pointer, int) (h, a, l);

Designated initializer.


OutputStream
  write OutputStream s;

Output the address in dotted decimal octet notation.

class too.InetHost

inherits

State supers: State, Host

variables

static MutableDictionary hosts_by_name;

All internet hosts currently known, keyed on their name(s).

static MutableDictionary hosts_by_addr;

All internet hosts currently known, keyed on their address(es).

static InetHost local_host_any;

The wildcard local host.

methods


instance (id)
  addressed InetAddress addr;

Return the host known with the address addr. If the host can be found in the cache, no lookup is performed.


protected void
  cacheHost instance (id) h;

Add the host h to the cache.


void
  initialize;

Undocumented.


void
  load Array arguments;

Undocumented.


instance (id)
  named String name;

Return the host named name. If the host can be found in the cache, no lookup is performed.


protected instance (id)
  hostWithAddress InetAddress addr;

Perform a lookup of the host addressed addr. Return the host, or nil if it could not be found. The cache remains unaffected.


protected instance (id)
  hostWithName String name;

Perform a lookup of the host named name. Return the host, or nil if it could not be found. The cache remains unaffected.


protected instance (id)
  with (Array, Array) (n, a);

Return a newly allocated host with the names n and addresses a.

instance too.InetHost

variables

public Array names;

The names by which this host is known.

public Array addresses;

The addresses by which this host is known.

methods


id
  init (Array, Array) (n, a);

Designated initializer.


String
  name;

Undocumented.

class too.InetPort

An InetPort is an abstract port on an internet host.

inherits

State supers: Port, State

methods


instance (id)
  with int port
    at InetAddress address;

Return a newly created InetPort with the address and the port.

instance too.InetPort

variables

public InetAddress address;

The address (of the host) at which this port resides.

public int port;

The port on the host.

methods


boolean
  equal id other;

Undocumented.


int
  hash;

Undocumented.


protected id
  initWithPort int p
            at InetAddress a;

Designated initializer.


OutputStream
  write OutputStream s;

Output the address in dotted decimal octet notation followed by a colon and the port number.

class too.ConnectedInetPort

A ConnectedInetPort is a bytestream on a connected TCP socket.

inherits

State supers: ConnectedPort, InetPort

instance too.ConnectedInetPort

variables

public InetPort server;

Description of the server to which we connected or from which we accepted. In the latter case, this will be a ServerInetPort.

InetPort peer;

The peer socket. Set by invoking InetPort [self peer].

methods


protected id
  initWithPort int p
            at InetAddress a;

Designated initializer. Connect to the port p at the address a.


id
  initWithPort int p
            at InetAddress a
    descriptor int d
        server ServerInetPort s
          peer InetPort pr;

Initialization used by `ConnectedInetPort [ServerInetPort accept]'.


InetPort
  peer;

Return the peer port.


void
  registerForRead DescriptorReadDelegate d;

Undocumented.


void
  registerForWrite DescriptorWriteDelegate d;

Undocumented.

class too.ServerInetPort

A ServerInetPort is a TCP port which is listening for connections to accept.

inherits

State supers: InetPort, ServerPort, Descriptor

instance too.ServerInetPort

methods


ConnectedInetPort
  accept;

Accept a connection on the receiving port, returning a connected port.


protected id
  initWithPort int port
            at InetAddress address;

Designated initializer. Listen on the port at the address. If the address is nil, any local address will do; if the port is 0, it is assigned by the operating system.


void
  registerForRead DescriptorReadDelegate d;

Undocumented.