Class TCPEntity.Context

java.lang.Object
  extended by TCPEntity.Context
Enclosing class:
TCPEntity

public class TCPEntity.Context
extends java.lang.Object

A Context is created by a TCPEntity and passed to its RDTProtocol during set up of the TCPEntity. The Context gives the RDTProtocol access to private data of the TCPEntity. After setUp() is invoked, the data accessed through the Context is not accessed except on the protocol thread so the access can be unsynchronized.


Constructor Summary
TCPEntity.Context()
           
 
Method Summary
 Packet createPacket()
          cntxt.createPacket() returns a new packet that only requires setting its identification number an sequence number befor use.
 RDTTimer createTimer()
          cntxt.createTimer() returns a new timer that only requires setting its packet before use.
 java.lang.String getName()
          cntxt.getName() returns the name of the TCPEntity that created this Context.
 void reassemble(int id)
          cntxt.reassemble(id) sends the segment id to the reassembler of this TCPEntity.
 void setAcceptingNewSegments(boolean ans)
          cntxt.setAcceptingNewSegments(ans) allows this TCPEntity to schedule new segment tasks if ans is true.
 void setPendingAcknowledgements(boolean pa)
          cntxt.setPendingAcknowledgements(pa) notifies this TCPEntity that its protocol has packets that have been sent but not yet acknowledged.
 void terminate()
          cntxt.terminate() terminates the execution of the thread created by this TCPEntity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPEntity.Context

public TCPEntity.Context()
Method Detail

createPacket

public Packet createPacket()
cntxt.createPacket() returns a new packet that only requires setting its identification number an sequence number befor use.


createTimer

public RDTTimer createTimer()
cntxt.createTimer() returns a new timer that only requires setting its packet before use.


setAcceptingNewSegments

public void setAcceptingNewSegments(boolean ans)
cntxt.setAcceptingNewSegments(ans) allows this TCPEntity to schedule new segment tasks if ans is true.


setPendingAcknowledgements

public void setPendingAcknowledgements(boolean pa)
cntxt.setPendingAcknowledgements(pa) notifies this TCPEntity that its protocol has packets that have been sent but not yet acknowledged.


reassemble

public void reassemble(int id)
cntxt.reassemble(id) sends the segment id to the reassembler of this TCPEntity.


terminate

public void terminate()
cntxt.terminate() terminates the execution of the thread created by this TCPEntity.


getName

public java.lang.String getName()
cntxt.getName() returns the name of the TCPEntity that created this Context.