bttrackerresponse.java
来自「p2p仿真」· Java 代码 · 共 61 行
JAVA
61 行
/*
* @(#)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 + =
减小字号Ctrl + -
显示快捷键?