⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bttrackerresponse.java

📁 p2p仿真
💻 JAVA
字号:
/*
 * @(#)BTTrackerResponse.java	ver 1.2  6/20/2005
 *
 * Copyright 2005 Weishuai Yang (wyang@cs.binghamton.edu). 
 * All rights reserved.
 * 
 */

package gps.protocol.BT.param;
import java.util.ArrayList;

/**
 * response message from tracker
 * 
 * @author  Weishuai Yang
 * @version 1.2,  6/20/2005
 */
public class BTTrackerResponse {
	/**
	 * document hash key, to indentify which document is talking about
	 */
	public String mDocHashKey=null;
	/**
	 * request failed or not
	 */
	public boolean mFailure=false;
	/**
	 * interval for next request
	 */
	public int mInterval=2*60;
	/**
	 * peer list containing the document
	 */
	public ArrayList mPeers=null;
	
	/**
	 * constructs tracker response object for a failure
	 * @param key the hash key of the document
	 */
	public BTTrackerResponse(String key){
		mDocHashKey=key;
		mFailure=true;
	}
	/**
	 * constructs tracker response object for a success
	 * @param key the hash key of the document
	 * @param peers peer list containing the document
	 */
	public BTTrackerResponse(String key, ArrayList peers){
		mDocHashKey=key;
		mPeers=peers;
	}
	/**
	 * change default interval
	 * @param interval new interval
	 */
	public void setInterval(int interval){
		mInterval=interval;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -