本文整理汇总了Java中net.fs.rudp.SendRecord类的典型用法代码示例。如果您正苦于以下问题:Java SendRecord类的具体用法?Java SendRecord怎么用?Java SendRecord使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SendRecord类属于net.fs.rudp包,在下文中一共展示了SendRecord类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: AckListMessage
import net.fs.rudp.SendRecord; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public AckListMessage(long connId,ArrayList ackList,int lastRead,
HashMap<Integer, SendRecord> sendRecordTable,int timeId,
int connectId,int clientId){
this.clientId=clientId;
this.connectId=connectId;
this.ackList=ackList;
this.lastRead=lastRead;
int len1=4+4+10+4*ackList.size();
dpData=new byte[len1+24+9];
sType=MessageType.sType_AckListMessage;
ByteShortConvert.toByteArray(ver, dpData, 0); //add: ver
ByteShortConvert.toByteArray(sType, dpData, 2); //add: service type
ByteIntConvert.toByteArray(connectId, dpData, 4); //add: sequence
ByteIntConvert.toByteArray(clientId, dpData, 8); //add: sequence
ByteIntConvert.toByteArray(lastRead, dpData, 4+8);
//dpData[8]=(byte) ackList.size();
ByteShortConvert.toByteArray((short) ackList.size(), dpData, 8+8); //add: service type
for(int i=0;i<ackList.size();i++){
int sequence=(Integer)ackList.get(i);
ByteIntConvert.toByteArray(sequence, dpData, 10+4*i+8); //add: sequence
////#MLog.println("发送确认 "+sequence);
}
int u1=timeId-2;
ByteIntConvert.toByteArray(u1, dpData,len1+8);
SendRecord r1=sendRecordTable.get(u1);
int s1=0;
if(r1!=null){
s1=r1.getSendSize();
}
ByteIntConvert.toByteArray(s1, dpData, len1+4+8);
int u2=timeId-1;
ByteIntConvert.toByteArray(u2, dpData,len1+8+8);
SendRecord r2=sendRecordTable.get(u2);
int s2=0;
if(r2!=null){
s2=r2.getSendSize();
}
ByteIntConvert.toByteArray(s2, dpData, len1+12+8);
int u3=timeId;
ByteIntConvert.toByteArray(u3, dpData,len1+16+8);
SendRecord r3=sendRecordTable.get(u3);
int s3=0;
if(r3!=null){
s3=r3.getSendSize();
}
ByteIntConvert.toByteArray(s3, dpData, len1+20+8);
dp=new DatagramPacket(dpData,dpData.length);
}
开发者ID:breakEval13,项目名称:NSS,代码行数:56,代码来源:AckListMessage.java
示例2: AckListMessage
import net.fs.rudp.SendRecord; //导入依赖的package包/类
public AckListMessage(long connId,ArrayList<Integer> ackList,int lastRead,
HashMap<Integer, SendRecord> sendRecordTable,int timeId,
int connectId,int clientId){
this.clientId=clientId;
this.connectId=connectId;
this.ackList=ackList;
this.lastRead=lastRead;
int len1=4+4+10+4*ackList.size();
dpData=new byte[len1+24+9];
sType=MessageType.sType_AckListMessage;
ByteShortConvert.toByteArray(ver, dpData, 0); //add: ver
ByteShortConvert.toByteArray(sType, dpData, 2); //add: service type
ByteIntConvert.toByteArray(connectId, dpData, 4); //add: sequence
ByteIntConvert.toByteArray(clientId, dpData, 8); //add: sequence
ByteIntConvert.toByteArray(lastRead, dpData, 4+8);
//dpData[8]=(byte) ackList.size();
ByteShortConvert.toByteArray((short) ackList.size(), dpData, 8+8); //add: service type
for(int i=0;i<ackList.size();i++){
int sequence=(Integer)ackList.get(i);
ByteIntConvert.toByteArray(sequence, dpData, 10+4*i+8); //add: sequence
////#MLog.println("???????????? "+sequence);
}
int u1=timeId-2;
ByteIntConvert.toByteArray(u1, dpData,len1+8);
SendRecord r1=sendRecordTable.get(u1);
int s1=0;
if(r1!=null){
s1=r1.getSendSize();
}
ByteIntConvert.toByteArray(s1, dpData, len1+4+8);
int u2=timeId-1;
ByteIntConvert.toByteArray(u2, dpData,len1+8+8);
SendRecord r2=sendRecordTable.get(u2);
int s2=0;
if(r2!=null){
s2=r2.getSendSize();
}
ByteIntConvert.toByteArray(s2, dpData, len1+12+8);
int u3=timeId;
ByteIntConvert.toByteArray(u3, dpData,len1+16+8);
SendRecord r3=sendRecordTable.get(u3);
int s3=0;
if(r3!=null){
s3=r3.getSendSize();
}
ByteIntConvert.toByteArray(s3, dpData, len1+20+8);
dp=new DatagramPacket(dpData,dpData.length);
}
开发者ID:RCD-Y,项目名称:FinalSpeed-X,代码行数:55,代码来源:AckListMessage.java
示例3: AckListMessage
import net.fs.rudp.SendRecord; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public AckListMessage(long connId, ArrayList ackList, int lastRead,
HashMap<Integer, SendRecord> sendRecordTable, int timeId,
int connectId, int clientId) {
this.clientId = clientId;
this.connectId = connectId;
this.ackList = ackList;
this.lastRead = lastRead;
int len1 = 4 + 4 + 10 + 4 * ackList.size();
dpData = new byte[len1 + 24 + 9];
sType = MessageType.sType_AckListMessage;
ByteShortConvert.toByteArray(ver, dpData, 0); //add: ver
ByteShortConvert.toByteArray(sType, dpData, 2); //add: service type
ByteIntConvert.toByteArray(connectId, dpData, 4); //add: sequence
ByteIntConvert.toByteArray(clientId, dpData, 8); //add: sequence
ByteIntConvert.toByteArray(lastRead, dpData, 4 + 8);
//dpData[8]=(byte) ackList.size();
ByteShortConvert.toByteArray((short) ackList.size(), dpData, 8 + 8); //add: service type
for (int i = 0; i < ackList.size(); i++) {
int sequence = (Integer) ackList.get(i);
ByteIntConvert.toByteArray(sequence, dpData, 10 + 4 * i + 8); //add: sequence
////#MLog.println("发送确认 "+sequence);
}
int u1 = timeId - 2;
ByteIntConvert.toByteArray(u1, dpData, len1 + 8);
SendRecord r1 = sendRecordTable.get(u1);
int s1 = 0;
if (r1 != null) {
s1 = r1.getSendSize();
}
ByteIntConvert.toByteArray(s1, dpData, len1 + 4 + 8);
int u2 = timeId - 1;
ByteIntConvert.toByteArray(u2, dpData, len1 + 8 + 8);
SendRecord r2 = sendRecordTable.get(u2);
int s2 = 0;
if (r2 != null) {
s2 = r2.getSendSize();
}
ByteIntConvert.toByteArray(s2, dpData, len1 + 12 + 8);
ByteIntConvert.toByteArray(timeId, dpData, len1 + 16 + 8);
SendRecord r3 = sendRecordTable.get(timeId);
int s3 = 0;
if (r3 != null) {
s3 = r3.getSendSize();
}
ByteIntConvert.toByteArray(s3, dpData, len1 + 20 + 8);
dp = new DatagramPacket(dpData, dpData.length);
}
开发者ID:Bpazy,项目名称:finalspeed,代码行数:55,代码来源:AckListMessage.java
注:本文中的net.fs.rudp.SendRecord类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论