public UDTSession(string description, Destination destination) { statistics = new UDTStatistics(description); mySocketID = Interlocked.Increment(ref nextSocketID); this.destination = destination; this.dgPacket = new UDPUserToken(destination.EndPoint); //String clazzP = System.getProperty(CC_CLASS, UDTCongestionControl.class.getName()); Object ccObject = null; ccObject = new UDTCongestionControl(this); //try{ // Class<?>clazz=Class.forName(clazzP); // ccObject=clazz.getDeclaredConstructor(UDTSession.class).newInstance(this); //}catch(Exception e){ // logger.log(Level.WARNING,"Can't setup congestion control class <"+clazzP+">, using default.",e); // ccObject=new UDTCongestionControl(this); //} cc = (ICongestionControl)ccObject; //logger.info("Using "+cc.getClass().getName()); }
/** * create a receiver with a valid {@link UDTSession} * @param session */ public UDTReceiver(UDTSession session, UDPEndPoint endpoint) { this.endpoint = endpoint; this.session = session; this.sessionUpSince = DateTime.Now.Ticks; this.statistics = session.Statistics; if (!session.IsReady) { throw new IllegalStateException("UDTSession is not ready."); } ackHistoryWindow = new AckHistoryWindow(16); packetHistoryWindow = new PacketHistoryWindow(16); receiverLossList = new ReceiverLossList(); packetPairWindow = new PacketPairWindow(16); largestReceivedSeqNumber = session.InitialSequenceNumber - 1; bufferSize = session.ReceiveBufferSize; handoffQueue = new BlockingCollection <IUDTPacket>(4 * session.FlowWindowSize); //storeStatistics=bool.getbool("udt.receiver.storeStatistics"); InitMetrics(); Start(); }
public UDTSender(UDTSession session, UDPEndPoint endpoint) { if (!session.IsReady) { throw new IllegalStateException("UDTSession is not ready."); } this.endpoint = endpoint; this.session = session; statistics = session.Statistics; senderLossList = new SenderLossList(); sendBuffer = new ConcurrentDictionary <long, DataPacket>(session.FlowWindowSize, 2); sendQueue = new BlockingCollection <DataPacket>(1000); lastAckSequenceNumber = session.InitialSequenceNumber; currentSequenceNumber = session.InitialSequenceNumber - 1; //waitForAckLatch.set(new CountDownLatch(1)); //waitForSeqAckLatch.set(new CountDownLatch(1)); //storeStatistics=bool.getbool("udt.sender.storeStatistics"); InitMetrics(); DoStart(); }
public UDTCongestionControl(UDTSession session) { this.session = session; this.statistics = session.Statistics; lastDecreaseSeqNo = session.InitialSequenceNumber - 1; }