All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ants.Channel

java.lang.Object
   |
   +----ants.Entity
           |
           +----ants.ManagedObject
                   |
                   +----ants.Channel

public abstract class Channel
extends ManagedObject
Channel used by nodes to exchanged capsule with one another.

The abstract class Channel knows how to encode outgoing capsules. Subclasses, such as UDPChannel, implement the actual send operation.

See Also:
UDPChannel

Variable Index

 o ANTSVERSION
 o client
 o clientAddress
 o source
 o txbuf

Constructor Index

 o Channel(Manager, String, ChannelAddress)
 o Channel(Manager, String, ChannelAddress, int)

Method Index

 o attachNode(Node)
 o encode(Capsule)
Encode an outgoing capsule.
 o New(Manager, String, String)
 o send(Capsule, ChannelAddress)
Send a capsule to a given destination.

Variables

 o source
 public ChannelAddress source
 o client
 public Node client
 o clientAddress
 public int clientAddress
 o txbuf
 protected Buffer txbuf
 o ANTSVERSION
 protected static int ANTSVERSION

Constructors

 o Channel
 public Channel(Manager b,
                String n,
                ChannelAddress src)
 o Channel
 public Channel(Manager b,
                String n,
                ChannelAddress src,
                int q)

Methods

 o encode
 public Xdr encode(Capsule cap)
Encode an outgoing capsule.

This writes the ANEP and ANTS header for an outgoing capsule in its associated Xdr.

Parameters:
cap - Capsule to be encoded.
Returns:
Xdr returns Xdr in which the rest of the capsule can be encoded.
 o attachNode
 public void attachNode(Node c)
 o send
 public final boolean send(Capsule cap,
                           ChannelAddress dst)
Send a capsule to a given destination.

 o New
 public static Channel New(Manager b,
                           String n,
                           String src) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index