update LogicFaceICN

This commit is contained in:
free will
2021-04-26 18:14:08 +08:00
parent 2f010e30a3
commit 07f1635009
+14 -4
View File
@@ -230,7 +230,7 @@ public class LogicFaceICN extends LogicFace {
public void doReceivePacket() throws LogicFaceException {
try {
while (true) {
MINPacket minPacket = this.receivePacket();
MINPacket minPacket = this.receivePacket(-1);
if(minPacket==null){
LoggerHelper.logger.debug("LogicFaceICN.doReceivePacket: receivePacket null");
return;
@@ -382,14 +382,24 @@ public class LogicFaceICN extends LogicFace {
}
}
// TODO:似乎更新了
public void registerPrefix(Identifier identifier,OnInterestInterface onInterestInterface,
/**
* 设置一个标识监听,并绑定监听的函数,通过fib表来记录什么前缀对应什么兴趣包到达处理函数
* @param identifier 监听的标识
* @param timeout 注册前缀超时时间
* @param helper
* @param onInterestInterface 收到兴趣包的处理函数
* @param onRegisterFailInterface 注册标识失败的回调函数
* @param onRegisterSuccessInterface 注册标识成功的回调函数
* @throws LogicFaceException
*/
public void registerPrefix(Identifier identifier,long timeout, IRegisterPrefixHelper helper,
OnInterestInterface onInterestInterface,
OnRegisterFailInterface onRegisterFailInterface,
OnRegisterSuccessInterface onRegisterSuccessInterface) throws LogicFaceException {
if(this.mFib==null){
this.mFib=new HashMap<>();
}
boolean res=this.registerIdentifier(identifier,3);
boolean res=this.registerIdentifier(identifier,timeout,helper);
if(!res){
onRegisterFailInterface.onRegisterFail(identifier);
return;