FileDocCategorySizeDatePackage
BTKeepAlive.javaAPI DocAzureus 3.0.3.43152Sun Mar 04 21:08:16 GMT 2007com.aelitis.azureus.core.peermanager.messaging.bittorrent

BTKeepAlive

public class BTKeepAlive extends Object implements com.aelitis.azureus.core.networkmanager.RawMessage, BTMessage
BitTorrent keep-alive message.

Fields Summary
private byte
version
private DirectByteBuffer[]
buffer
Constructors Summary
public BTKeepAlive(byte _version)

  
  
     
    version = _version;
  
Methods Summary
public com.aelitis.azureus.core.peermanager.messaging.Messagedeserialize(DirectByteBuffer data, byte version)

   
    if( data != null && data.hasRemaining( DirectByteBuffer.SS_MSG ) ) {
      throw new MessageException( "[" +getID() +"] decode error: payload not empty" );
    }
    
    if( data != null )  data.returnToPool();
    
    return new BTKeepAlive(version);
  
public voiddestroy()

    if( buffer != null ) {
      buffer[0].returnToPool();
    }
  
public com.aelitis.azureus.core.peermanager.messaging.MessagegetBaseMessage()

  return this;  
public DirectByteBuffer[]getData()

  return new DirectByteBuffer[]{};  
public java.lang.StringgetDescription()

  return BTMessage.ID_BT_KEEP_ALIVE;  
public java.lang.StringgetFeatureID()

  return BTMessage.BT_FEATURE_ID;  
public intgetFeatureSubID()

  return BTMessage.SUBID_BT_KEEP_ALIVE;  
public java.lang.StringgetID()

  return BTMessage.ID_BT_KEEP_ALIVE;  
public byte[]getIDBytes()

  return BTMessage.ID_BT_KEEP_ALIVE_BYTES;  
public intgetPriority()

  return RawMessage.PRIORITY_LOW;  
public DirectByteBuffer[]getRawData()

    if( buffer == null ) {
      DirectByteBuffer dbb = DirectByteBufferPool.getBuffer( DirectByteBuffer.AL_MSG_BT_KEEPALIVE, 4 );
      dbb.putInt( DirectByteBuffer.SS_BT, 0 );
      dbb.flip( DirectByteBuffer.SS_BT );
      buffer = new DirectByteBuffer[]{ dbb };
    }
    
    return buffer;
  
public intgetType()

  return Message.TYPE_PROTOCOL_PAYLOAD;  
public bytegetVersion()

 return version; 
public booleanisNoDelay()

  return false;  
public com.aelitis.azureus.core.peermanager.messaging.Message[]messagesToRemove()

  return null;