FileDocCategorySizeDatePackage
DHTUDPPacketRequestStore.javaAPI DocAzureus 3.0.3.43870Thu Feb 09 19:42:52 GMT 2006com.aelitis.azureus.core.dht.transport.udp.impl

DHTUDPPacketRequestStore

public class DHTUDPPacketRequestStore extends DHTUDPPacketRequest
author
parg

Fields Summary
public static final int
MAX_KEYS_PER_PACKET
public static final int
MAX_VALUES_PER_KEY
private int
random_id
private byte[]
keys
private com.aelitis.azureus.core.dht.transport.DHTTransportValue[]
value_sets
Constructors Summary
public DHTUDPPacketRequestStore(DHTTransportUDPImpl _transport, long _connection_id, DHTTransportUDPContactImpl _local_contact, DHTTransportUDPContactImpl _remote_contact)

	
	
	
						
									
				
				 
	
		super( _transport, DHTUDPPacketHelper.ACT_REQUEST_STORE, _connection_id, _local_contact, _remote_contact );
	
protected DHTUDPPacketRequestStore(com.aelitis.azureus.core.dht.transport.udp.impl.packethandler.DHTUDPPacketNetworkHandler network_handler, DataInputStream is, long con_id, int trans_id)

		super( network_handler, is,  DHTUDPPacketHelper.ACT_REQUEST_STORE, con_id, trans_id );
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_ANTI_SPOOF ){
			
			random_id	= is.readInt();
		}

		keys		= DHTUDPUtils.deserialiseByteArrayArray( is, MAX_KEYS_PER_PACKET );
		
			// times receieved are adjusted by + skew
				
		value_sets 	= DHTUDPUtils.deserialiseTransportValuesArray( this, is, getClockSkew(), MAX_VALUES_PER_KEY );
		
		super.postDeserialise(is);
	
Methods Summary
protected byte[][]getKeys()

		return( keys );
	
protected intgetRandomID()

		return( random_id );
	
public java.lang.StringgetString()

		return( super.getString());
	
protected com.aelitis.azureus.core.dht.transport.DHTTransportValue[][]getValueSets()

		return( value_sets );
	
public voidserialise(java.io.DataOutputStream os)

		super.serialise(os);
		
		if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_ANTI_SPOOF ){
			
			os.writeInt( random_id );
		}
		
		DHTUDPUtils.serialiseByteArrayArray( os, keys, MAX_KEYS_PER_PACKET );
		
		try{
			DHTUDPUtils.serialiseTransportValuesArray( this, os, value_sets, 0, MAX_VALUES_PER_KEY );
			
		}catch( DHTTransportException e ){
			
			throw( new IOException( e.getMessage()));
		}
		
		super.postSerialise( os );
	
protected voidsetKeys(byte[][] _key)

		keys	= _key;
	
protected voidsetRandomID(int _random_id)

		random_id	= _random_id;
	
protected voidsetValueSets(com.aelitis.azureus.core.dht.transport.DHTTransportValue[][] _values)

		value_sets	= _values;