Methods Summary |
---|
public boolean | canProcess(EventWaiter waiter)
if( !connection.getTransportBase().isReadyForRead( waiter ) ) {
return false; //underlying transport not ready
}
if( rate_handler.getCurrentNumBytesAllowed() < 1 ) {
return false; //not allowed to receive any bytes
}
return true;
|
public boolean | doProcessing(EventWaiter waiter)
if( !connection.getTransportBase().isReadyForRead(waiter) ) {
return false;
}
int num_bytes_allowed = rate_handler.getCurrentNumBytesAllowed();
if( num_bytes_allowed < 1 ) {
return false;
}
//int mss = NetworkManager.getTcpMssSize();
//if( num_bytes_allowed > mss ) num_bytes_allowed = mss;
int bytes_read = 0;
try {
bytes_read = connection.getIncomingMessageQueue().receiveFromTransport( num_bytes_allowed );
}
catch( Throwable e ) {
if( AEDiagnostics.TRACE_CONNECTION_DROPS ) {
if( e.getMessage() == null ) {
Debug.out( "null read exception message: ", e );
}
else {
if( e.getMessage().indexOf( "end of stream on socket read" ) == -1 &&
e.getMessage().indexOf( "An existing connection was forcibly closed by the remote host" ) == -1 &&
e.getMessage().indexOf( "Connection reset by peer" ) == -1 &&
e.getMessage().indexOf( "An established connection was aborted by the software in your host machine" ) == -1 ) {
System.out.println( "SP: read exception [" +connection.getTransportBase().getDescription()+ "]: " +e.getMessage() );
}
}
}
if (! (e instanceof IOException )){
Debug.printStackTrace(e);
}
connection.notifyOfException( e );
return false;
}
if( bytes_read < 1 ) {
return false;
}
rate_handler.bytesProcessed( bytes_read );
return true;
|
public long | getBytesReadyToWrite()
return( 0 );
|
public int | getConnectionCount()
return( 1 );
|
public int | getPriority()
return RateControlledEntity.PRIORITY_NORMAL;
|
public int | getReadyConnectionCount(EventWaiter waiter)
if ( connection.getTransportBase().isReadyForRead( waiter)){
return( 1 );
}
return( 0 );
|
public java.lang.String | getString()
return( "SPD: " + connection.getString());
|