FileDocCategorySizeDatePackage
PRUDPPacketReplyAnnounce.javaAPI DocAzureus 3.0.3.42572Thu Jan 05 05:43:26 GMT 2006org.gudy.azureus2.core3.tracker.protocol.udp

PRUDPPacketReplyAnnounce

public class PRUDPPacketReplyAnnounce extends com.aelitis.net.udp.uc.PRUDPPacketReply
author
parg

Fields Summary
protected int
interval
protected static final int
BYTES_PER_ENTRY
protected int[]
addresses
protected short[]
ports
Constructors Summary
public PRUDPPacketReplyAnnounce(int trans_id)

	
	
	
					 
	
		super( PRUDPPacketTracker.ACT_REPLY_ANNOUNCE, trans_id );
	
protected PRUDPPacketReplyAnnounce(DataInputStream is, int trans_id)

		super( PRUDPPacketTracker.ACT_REPLY_ANNOUNCE, trans_id );
		
		interval = is.readInt();
		
		addresses 	= new int[is.available()/BYTES_PER_ENTRY];
		ports		= new short[addresses.length];
		
		for (int i=0;i<addresses.length;i++){
			
			addresses[i] 	= is.readInt();
			ports[i]		= is.readShort();
		}
	
Methods Summary
public int[]getAddresses()

		return( addresses );
	
public intgetInterval()

		return( interval );
	
public short[]getPorts()

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

		return( super.getString().concat("[interval=").concat(String.valueOf(interval)).concat(", addresses=").concat(String.valueOf(addresses.length)).concat("]") );
	
public voidserialise(java.io.DataOutputStream os)

		super.serialise(os);
		
		os.writeInt( interval );
		
		if ( addresses != null ){
			
			for (int i=0;i<addresses.length;i++){
			
				os.writeInt( addresses[i] );
				os.writeShort( ports[i] );
			}
		}
	
public voidsetInterval(int value)

		interval	= value;
	
public voidsetPeers(int[] _addresses, short[] _ports)

		addresses 	= _addresses;
		ports		= _ports;