All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface network.Network

public interface Network
Interface for a generic network. Networks support sending and receiving of addressed packets. Clients using a network will need to implement the NetworkClient interface to receive packets. Packets are submitted to the network with the TransmitPacket function.


Method Index

 o AddReceiver(PacketReceiver, Address)
Connect an addressed client to the network.
 o MTU()
Query the maximum transmission size of the network.
 o RemoveReceiver(PacketReceiver)
Disconnect this client from the network.
 o TransmitPacket(NetworkPacket)
Submit a packet to the network, for delivery to the client whose address is in the destinationAddr field of the packet.

Methods

 o TransmitPacket
 public abstract void TransmitPacket(NetworkPacket p)
Submit a packet to the network, for delivery to the client whose address is in the destinationAddr field of the packet. Blocks for whatever transmission time the network imposes.

Parameters:
p - the packet to transmit.
 o MTU
 public abstract int MTU()
Query the maximum transmission size of the network.

Returns:
the maximum transmission unit, in bytes
 o AddReceiver
 public abstract void AddReceiver(PacketReceiver client,
                                  Address address)
Connect an addressed client to the network. Any packets which arrive with this client's address will now be routed to this client by calling the PacketArrived method.

Parameters:
client - the network client wishing to receive packets
address - the address of this client
See Also:
PacketReceiver
 o RemoveReceiver
 public abstract void RemoveReceiver(PacketReceiver clinet)
Disconnect this client from the network.

Parameters:
client - the network client which will no longer receive packets

All Packages  Class Hierarchy  This Package  Previous  Next  Index