10.2. File too/Connection

class too.Connection

inherits

State supers: State, DescriptorReadDelegate, Constants

variables

static MutableEqSet all_connections;

All connection objects.

methods


instance (id)
  alloc;

Store the new connection in the all_connections.


void
       connection Connection connection
  remoteProxyDead int identity
pre
  !!all_connections[connection];

Pass this message to the connection.

instance too.Connection

variables

public Any root;

The root object of this connection.

public Port port;

The Port serving this connection.

MutableEqDictionary local_objects;

The set of local proxies, keyed on their local object.

MutableIntDictionary local_proxies;

The set of local proxies, keyed on their identity.

MutableIntDictionary remote_proxies;

The set of remote proxies, keyed on their identity.

MutableIntArray unreported_deaths;

The set of remote proxy identities that are dead here and which need to be sent to the other side.

int last_proxy_ident;

The last number used as a local proxy identity.

methods


id (self)
  initWithPort Port p;

Designated initializer.


protected IntDictionary
  local_proxies;

Other connections may inspect our proxies.


Any (object)
  localObject int identity
post
  object != nil;

Return the local object identified by the identity to the other side.


Proxy
  localProxyFor All object
pre
  object != nil;

Return the local proxy to identify the local object.


Any
  remoteObject int identity;

Return the remote object identified by the identity by the other side.


void
  localProxyRelease int identity
pre
  !!local_proxies[identity];

Be informed that the local proxy with the identity has one less remote proxy to care for. If that number reaches zero, the local proxy object is removed.


void
  remoteProxyDead int identity;

By informed (by our remote proxy with the identity) of the GC death of a remote proxy.

Note that this method is invoked during GC and that no new objects should be allocated.

class too.ServerConnection

inherits

State supers: Connection

instance too.ServerConnection

variables

redeclare ServerPort port;

Our port is only here for accepting connections.

methods


id (self)
  initWithPort ServerPort p;

Designated initializer.


void
  set_root All r;

Undocumented.


void
  readEventOnDescriptor ServerInetPort p;

Instantiate another ConnectedConnection.

class too.ConnectedConnection

inherits

State supers: Connection, DescriptorWriteDelegate, Conditions

instance too.ConnectedConnection

variables

redeclare ConnectedPort port;

We are actually connected.

PortDecoder decoder;

Our decoder.

PortEncoder encoder;

Our encoder.

ServerConnection master;

If we're a slave connection (i.e. the working part for a published connection), this is the published server connection.

boolean invalid;

Iff TRUE, we've lost the connection.

methods


id (self)
  initWithPort ConnectedPort p;

Initializer for a client connection.


id (self)
  initWithPort ConnectedPort p
           for ServerConnection server;

Initializer for a slave connection, i.e. a slave to the server connection.


protected void
  initDetails;

Do part of the work for either initializer.


void
  invalidate;

Undocumented.


ConnectedPort
  port;

Undocumented.


Any
  localObject int identity;

Forward to the master if we have one.


Proxy
  localProxyFor All object;

Forward to the master if we have one.


void
  localProxyRelease int identity
pre
  !!master -> !![master local_proxies][identity];

Forward to the master if we have one.


InvocationResult
  forward Invocation invocation;

Forward the invocation to the other side.


void
  readEventOnDescriptor ConnectedInetPort p;

Undocumented.