com.caucho.network.balance
Interface ClientSocketApi

All Known Implementing Classes:
ClientSocket

public interface ClientSocketApi

Defines a connection to the client.


Method Summary
 void clearIdleStartTime()
          Sets the idle start time.
 void clearRecycle()
          Clears the recycled connections.
 void close()
           
 void free(long idleStartTime)
          Adds the stream to the free pool.
 java.lang.String getDebugId()
          Returns the debug id.
 long getIdleStartTime()
          Returns the idle start time, i.e.
 ReadStream getInputStream()
          Returns the input stream.
 WriteStream getOutputStream()
          Returns the write stream.
 ClientSocketFactory getPool()
          Returns the owning pool
 boolean isClosed()
           
 boolean isIdleAlmostExpired(long delta)
          Returns true if nearing end of free time.
 boolean isIdleExpired()
          Returns true if nearing end of free time.
 boolean isPoolSequenceIdValid()
          Returns true if the sequence id is valid.
 void setIdleStartTime(long idleStartTime)
          Sets the idle start time.
 void toActive()
           
 

Method Detail

getPool

ClientSocketFactory getPool()
Returns the owning pool


getInputStream

ReadStream getInputStream()
Returns the input stream.


getOutputStream

WriteStream getOutputStream()
Returns the write stream.


getIdleStartTime

long getIdleStartTime()
Returns the idle start time, i.e. the time the connection was last idle.


setIdleStartTime

void setIdleStartTime(long idleStartTime)
Sets the idle start time. Because of clock skew and tcp delays, it's often better to use the request start time instead of the request end time for the idle start time.


clearIdleStartTime

void clearIdleStartTime()
Sets the idle start time.


isIdleExpired

boolean isIdleExpired()
Returns true if nearing end of free time.


isIdleAlmostExpired

boolean isIdleAlmostExpired(long delta)
Returns true if nearing end of free time.


isPoolSequenceIdValid

boolean isPoolSequenceIdValid()
Returns true if the sequence id is valid.


getDebugId

java.lang.String getDebugId()
Returns the debug id.


clearRecycle

void clearRecycle()
Clears the recycled connections.


free

void free(long idleStartTime)
Adds the stream to the free pool. The idleStartTime may be earlier than the current time to deal with TCP buffer delays. Typically it will be recorded as the start time of the request's write.

Parameters:
idleStartTime - the time to be used as the start of the idle period.

toActive

void toActive()

isClosed

boolean isClosed()

close

void close()