Exemple #1
0
 /**
  * @param host
  * @param port
  * @param endpoint
  * @throws SocketException,UnknownHostException
  */
 public UDTSocket(UDPEndPoint endpoint, UDTSession session)
 {
     this.endpoint = endpoint;
     this.session  = session;
     this.receiver = new UDTReceiver(session, endpoint);
     this.sender   = new UDTSender(session, endpoint);
 }
Exemple #2
0
 /**
  * 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();
 }
Exemple #3
0
        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();
        }
Exemple #4
0
 public UDTClient(UDPEndPoint endpoint)
 {
     clientEndpoint = endpoint;
 }
Exemple #5
0
 public UDTClient(string address)
 {
     //create endpoint
     clientEndpoint = new UDPEndPoint(0, address);
     // logger.info("Created client endpoint on port " + clientEndpoint.getLocalPort());
 }
Exemple #6
0
 public UDTClient(int localport = 0, string address = null)
 {
     //create endpoint
     clientEndpoint = new UDPEndPoint(localport, address);
     // logger.info("Created client endpoint on port " + localport);
 }
Exemple #7
0
 public volatile int connectNum = 0;//cd
 public ClientSession(UDPEndPoint endPoint, Destination dest) : base("ClientSession localPort=" + endPoint.LocalPort, dest)
 {
     this.endPoint = endPoint;
     // logger.info("Created " + toString());
 }
Exemple #8
0
 /**
  * create a UDT ServerSocket
  * @param localAddress
  * @param port - the local port. If 0, an ephemeral port will be chosen
  */
 public UDTServerSocket(int port, string localAddress = null)
 {
     endpoint = new UDPEndPoint(port, localAddress);
     FlashLogger.Info("Created server endpoint on port " + endpoint.LocalPort);
 }
Exemple #9
0
 public ServerSession(IPEndPoint dp, UDPEndPoint endPoint) : base("ServerSession localPort=" + endPoint.LocalPort + " peer=" + dp.Address.ToString() + ":" + dp.Port, new Destination(dp))
 {
     this.endPoint = endPoint;
     client        = dp.Address + ":" + dp.Port + ":" + DateTime.Now.Ticks;
     FlashLogger.Info("Created " + toString() + " talking to " + dp.Address + ":" + dp.Port);
 }