JXTA

net.jxta.impl.util.pipe.reliable
Class OutgoingPipeAdaptor

java.lang.Object
  extended by net.jxta.impl.util.pipe.reliable.OutgoingPipeAdaptor
All Implemented Interfaces:
Outgoing

public class OutgoingPipeAdaptor
extends Object
implements Outgoing


Constructor Summary
OutgoingPipeAdaptor(OutputPipe pipe, int wsize)
           
 
Method Summary
 void close()
          Close the connection.
 long getIdleTimeout()
          Amount of time after which a connection is considered idle and may be scavenged.
 long getLastAccessed()
          Get the time when this connection was last used.
 long getMaxRetryAge()
          Amount if time during which retries may remain queued for retransmission.
 long getMinIdleReconnectTime()
          Amount of a connection must be idle before a reconnection attempt will be considered.
 boolean send(Message msg)
          Send a message to the remote peer.
 void setLastAccessed(long time)
          Set the time when this connection was last used.
 void setTimeout(int timeout)
          Sets the Timeout attribute.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutgoingPipeAdaptor

public OutgoingPipeAdaptor(OutputPipe pipe,
                           int wsize)
Method Detail

toString

public String toString()

Overrides:
toString in class Object

send

public boolean send(Message msg)
             throws IOException
Send a message to the remote peer.

Specified by:
send in interface Outgoing
Parameters:
msg - the message
Returns:
true is successful
Throws:
IOException - if io error occurs

close

public void close()
Close the connection.

Specified by:
close in interface Outgoing

getMinIdleReconnectTime

public long getMinIdleReconnectTime()
Amount of a connection must be idle before a reconnection attempt will be considered.

Specified by:
getMinIdleReconnectTime in interface Outgoing
Returns:
min idle reconnect time in millis

setTimeout

public void setTimeout(int timeout)
Sets the Timeout attribute. A timeout of 0 blocks forever

Specified by:
setTimeout in interface Outgoing
Parameters:
timeout - The new soTimeout value

getIdleTimeout

public long getIdleTimeout()
Amount of time after which a connection is considered idle and may be scavenged.

Default should be "never", otherwise, connection closes while not in active use and ReliableOutputStream does NOT reconnect automatically.

Specified by:
getIdleTimeout in interface Outgoing
Returns:
idle timeout in millis

getMaxRetryAge

public long getMaxRetryAge()
Amount if time during which retries may remain queued for retransmission. If still unACKed after this amount of time then the connection is considered dead.

This is the important tunable: how long to wait on a stale connection.

Specified by:
getMaxRetryAge in interface Outgoing
Returns:
max retry age in millis

getLastAccessed

public long getLastAccessed()
Get the time when this connection was last used.

Specified by:
getLastAccessed in interface Outgoing
Returns:
last accessed in millis

setLastAccessed

public void setLastAccessed(long time)
Set the time when this connection was last used.

Specified by:
setLastAccessed in interface Outgoing
Parameters:
time - in millis

JXSE