Rice Pastry API

rice.pastry.wire
Class DatagramTransmissionManager

java.lang.Object
  |
  +--rice.pastry.wire.DatagramTransmissionManager

public class DatagramTransmissionManager
extends java.lang.Object

Class which controls which object should be transmitted in the UPD version of the pastry protocol. This class is responsible for ensuring reliable and ordered delivery of packets to their destinations. This implementation is thread-safe, so both the client and pastry thread can access it at once.

Version:
$Id: DatagramTransmissionManager.java,v 1.17 2003/07/22 07:14:20 amislove Exp $
Author:
Alan Mislove

Field Summary
static int BEGIN_ACK_NUM
           
 
Constructor Summary
DatagramTransmissionManager(rice.pastry.wire.WirePastryNode spn, java.nio.channels.SelectionKey key)
          Builds a transmission manager for a given pastry node using a given key.
 
Method Summary
 void add(rice.pastry.wire.PendingWrite write)
          Adds a pending write to the queue.
 java.util.Iterator getReady()
          Returns an iterator over the pending writes ready to be written.
 void receivedAck(rice.pastry.wire.messaging.datagram.AcknowledgementMessage message)
          Callback mechanism designed to be called when an ack packet is received.
 void resetAckNumber(rice.pastry.NodeId node)
          Resets the sequence number for the specified node
 void wakeup()
          Designed to be called periodically in order for the Transmission Manager to decide if a packet has been lost.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEGIN_ACK_NUM

public static int BEGIN_ACK_NUM
Constructor Detail

DatagramTransmissionManager

public DatagramTransmissionManager(rice.pastry.wire.WirePastryNode spn,
                                   java.nio.channels.SelectionKey key)
Builds a transmission manager for a given pastry node using a given key.

Parameters:
spn - The pastry node this manager serves.
key - The key used by the datagram manager.
Method Detail

add

public void add(rice.pastry.wire.PendingWrite write)
Adds a pending write to the queue.

Parameters:
write - The pending write to add.

getReady

public java.util.Iterator getReady()
Returns an iterator over the pending writes ready to be written.

Returns:
An Iterator over PendingWrites, all ready to be written.

receivedAck

public void receivedAck(rice.pastry.wire.messaging.datagram.AcknowledgementMessage message)
Callback mechanism designed to be called when an ack packet is received. If there are more messasges in the queue, the appropriate entry will be set 'ready', and the next message will be sent across the wire on the next getReady() call.


wakeup

public void wakeup()
Designed to be called periodically in order for the Transmission Manager to decide if a packet has been lost.


resetAckNumber

public void resetAckNumber(rice.pastry.NodeId node)
Resets the sequence number for the specified node

Parameters:
node - The node to reset

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection