当前位置: 首页>>代码示例>>Java>>正文


Java DataMessage.setDstAddress方法代码示例

本文整理汇总了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连接已经关闭");
	}

}
 
开发者ID:breakEval13,项目名称:NSS,代码行数:45,代码来源:Sender.java

示例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");
	}

}
 
开发者ID:RCD-Y,项目名称:FinalSpeed-X,代码行数:45,代码来源:Sender.java

示例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连接已经关闭");
        }

    }
 
开发者ID:Bpazy,项目名称:finalspeed,代码行数:42,代码来源:Sender.java


注:本文中的net.fs.rudp.message.DataMessage.setDstAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。