本文整理汇总了Java中net.fs.rudp.message.DataMessage.setDstAddress方法的典型用法代码示例。如果您正苦于以下问题:Java DataMessage.setDstAddress方法的具体用法?Java DataMessage.setDstAddress怎么用?Java DataMessage.setDstAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.fs.rudp.message.DataMessage
的用法示例。
在下文中一共展示了DataMessage.setDstAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendNata
import net.fs.rudp.message.DataMessage; //导入方法依赖的package包/类
void sendNata(byte[] data,int offset,int length) throws ConnectException, InterruptedException{
if(!closed){
if(!streamClosed){
DataMessage me=new DataMessage(sequence,data,0,(short) length,conn.connectId,conn.route.localclientId);
me.setDstAddress(dstIp);
me.setDstPort(dstPort);
synchronized (syn_send_table) {
sendTable.put(me.getSequence(),me);
}
synchronized (winOb){
if(!conn.receiver.checkWin()){
try {
winOb.wait();
} catch (InterruptedException e) {
throw e;
}
}
}
boolean twice=false;
if(RUDPConfig.twice_tcp){
twice=true;
}
if(RUDPConfig.double_send_start){
if(me.getSequence()<=5){
twice=true;
}
}
sendDataMessage(me,false,twice,true);
lastSendTime=System.currentTimeMillis();
sendOffset++;
s+=me.getData().length;
conn.clientControl.resendMange.addTask(conn, sequence);
sequence++;//必须放最后
}else{
throw new ConnectException("RDP连接已断开sendData");
}
}else{
throw new ConnectException("RDP连接已经关闭");
}
}
示例2: sendNata
import net.fs.rudp.message.DataMessage; //导入方法依赖的package包/类
void sendNata(byte[] data,int offset,int length) throws ConnectException, InterruptedException{
if(!closed){
if(!streamClosed){
DataMessage me=new DataMessage(sequence,data,0,(short) length,conn.connectId,conn.route.localclientId);
me.setDstAddress(dstIp);
me.setDstPort(dstPort);
synchronized (syn_send_table) {
sendTable.put(me.getSequence(),me);
}
synchronized (winOb){
if(!conn.receiver.checkWin()){
try {
winOb.wait();
} catch (InterruptedException e) {
throw e;
}
}
}
boolean twice=false;
if(RUDPConfig.twice_tcp){
twice=true;
}
if(RUDPConfig.double_send_start){
if(me.getSequence()<=5){
twice=true;
}
}
sendDataMessage(me,false,twice,true);
lastSendTime=System.currentTimeMillis();
sendOffset++;
s+=me.getData().length;
conn.clientControl.resendMange.addTask(conn, sequence);
sequence++;//必须放最后
}else{
throw new ConnectException("RDP connction broken sendData");
}
}else{
throw new ConnectException("RDP connection closed");
}
}
示例3: sendNata
import net.fs.rudp.message.DataMessage; //导入方法依赖的package包/类
void sendNata(byte[] data, int offset, int length) throws ConnectException, InterruptedException {
if (!closed) {
if (!streamClosed) {
DataMessage me = new DataMessage(sequence, data, 0, (short) length, conn.connectId, conn.route
.localclientId);
me.setDstAddress(dstIp);
me.setDstPort(dstPort);
synchronized (syn_send_table) {
sendTable.put(me.getSequence(), me);
}
synchronized (winOb) {
if (!conn.receiver.checkWin()) {
winOb.wait();
}
}
boolean twice = false;
if (RUDPConfig.twice_tcp) {
twice = true;
}
if (RUDPConfig.double_send_start) {
if (me.getSequence() <= 5) {
twice = true;
}
}
sendDataMessage(me, false, twice, true);
lastSendTime = System.currentTimeMillis();
sendOffset++;
s += me.getData().length;
conn.clientControl.resendMange.addTask(conn, sequence);
sequence++;//必须放最后
} else {
throw new ConnectException("RDP连接已断开sendData");
}
} else {
throw new ConnectException("RDP连接已经关闭");
}
}