anon.client
Class SingleChannelDataChain

java.lang.Object
  extended by anon.client.AbstractDataChain
      extended by anon.client.SingleChannelDataChain
All Implemented Interfaces:
AnonChannel, java.lang.Runnable, java.util.Observer

public class SingleChannelDataChain
extends AbstractDataChain

Author:
Stefan Lieske

Nested Class Summary
private  class SingleChannelDataChain.ChainCell
           
private  class SingleChannelDataChain.InvalidChainCellException
           
 
Field Summary
private static short FLAG_FLOW_CONTROL
           
private  AbstractDataChannel m_associatedChannel
           
private  int m_chainType
           
private  boolean m_firstUpstreamPacket
           
private  boolean m_supportFlowControl
           
 
Fields inherited from interface anon.AnonChannel
HTTP, SMTP, SOCKS
 
Constructor Summary
SingleChannelDataChain(IDataChannelCreator a_channelCreator, DataChainErrorListener a_errorListener, int a_chainType, boolean a_supportFlowControl)
           
 
Method Summary
protected  void closeDataChain()
           
 void createPacketPayload(DataChainSendOrderStructure a_order)
           
 int getOutputBlockSize()
          Returns a value that indicates the current optimum size of data to write..
protected  void orderPacket(DataChainSendOrderStructure a_order)
           
protected  void outputStreamClosed()
           
 void run()
           
 
Methods inherited from class anon.client.AbstractDataChain
addInputStreamQueueEntry, close, createDataChannel, getInputStream, getMessageQueuesNotificationsList, getOutputStream, interruptDownstreamThread, propagateConnectionError, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG_FLOW_CONTROL

private static final short FLAG_FLOW_CONTROL
See Also:
Constant Field Values

m_chainType

private int m_chainType

m_supportFlowControl

private boolean m_supportFlowControl

m_associatedChannel

private AbstractDataChannel m_associatedChannel

m_firstUpstreamPacket

private boolean m_firstUpstreamPacket
Constructor Detail

SingleChannelDataChain

public SingleChannelDataChain(IDataChannelCreator a_channelCreator,
                              DataChainErrorListener a_errorListener,
                              int a_chainType,
                              boolean a_supportFlowControl)
Method Detail

getOutputBlockSize

public int getOutputBlockSize()
Description copied from interface: AnonChannel
Returns a value that indicates the current optimum size of data to write.. Because often anon services transport the data splited into packets for optimum performance it may be good to send data according to the packet size to avoid unneccessary overheads.

Specified by:
getOutputBlockSize in interface AnonChannel
Specified by:
getOutputBlockSize in class AbstractDataChain
Returns:
the current optimum size for output data. If 1 is returned the size does not matter.

createPacketPayload

public void createPacketPayload(DataChainSendOrderStructure a_order)
Specified by:
createPacketPayload in class AbstractDataChain

run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AbstractDataChain

orderPacket

protected void orderPacket(DataChainSendOrderStructure a_order)
Specified by:
orderPacket in class AbstractDataChain

outputStreamClosed

protected void outputStreamClosed()
                           throws java.io.IOException
Specified by:
outputStreamClosed in class AbstractDataChain
Throws:
java.io.IOException

closeDataChain

protected void closeDataChain()
Specified by:
closeDataChain in class AbstractDataChain