/**
* Public constructor
*
* @param id proposer id
* @param config path to config file
* @throws IOException
*/
public Learner(int id,String config) throws IOException{
this.ID = id;
if(Configuration.getConfiguration().isEmpty()){
Configuration.read(config);
}
NetworkInterface i = NetworkInterface.getByName(Configuration.getInterface());
this.channel = DatagramChannel.open(StandardProtocolFamily.INET)
.setOption(StandardSocketOptions.SO_REUSEADDR, true)
.bind(Configuration.getGroup(PaxosRole.Learner))
.setOption(StandardSocketOptions.IP_MULTICAST_IF, i);
this.channel.configureBlocking(false);
this.channel.join(Configuration.getGroup(PaxosRole.Learner).getAddress(), i);
for(int n=0;n<threadCount;n++){
executer.execute(new LearnerListener(this));
}
writer.execute(new LearnerWriter(this));
}
Learner.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:URingPaxos
作者:
评论列表
文章目录