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

PRUDPPacketReplyAnnounce2

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

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

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

		super( PRUDPPacketTracker.ACT_REPLY_ANNOUNCE, trans_id );
		
		interval = is.readInt();
		leechers = is.readInt();
		seeders  = 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 intgetLeechers()

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

		return( ports );
	
public intgetSeeders()

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

		return( super.getString() + 
				"[interval="+interval+
				",leechers="+leechers+
				",seeders="+seeders+
				",addresses="+addresses.length+"]");
	
public voidserialise(java.io.DataOutputStream os)

		super.serialise(os);
		
		os.writeInt( interval );
		os.writeInt( leechers );
		os.writeInt( seeders );
		
		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 voidsetLeechersSeeders(int _leechers, int _seeders)

		leechers	= _leechers;
		seeders		= _seeders;
	
public voidsetPeers(int[] _addresses, short[] _ports)

		addresses 	= _addresses;
		ports		= _ports;