Exemplo n.º 1
0
        public Rdt21(VirtualSocket client) : base()
        {
            socket = client;
            rdt    = new RdtUtils();
            socket.Start();

            socket.OnReceive += RdtReceive;
        }
Exemplo n.º 2
0
        /*This implementation has flaw where gbnWindow doesn't mean window per se,
         * more like whole seqnum space...Will do proper way with selective repeat.*/
        public GoBackN(VirtualSocket socket)
        {
            rdt         = new RdtUtils();
            this.socket = socket;
            socket.Start();

            socket.OnReceive += RdtReceive;

            gbnSendDictionary = new Dictionary <int, byte[]>();
            gbnLatestAck      = rdt.MakeAck(0);
        }
Exemplo n.º 3
0
 public SelectiveRepeat(VirtualSocket client)
 {
     cts        = new CancellationTokenSource();
     rcvBucket  = new Bucket();
     sendBucket = new Bucket();
     rdt        = new RdtUtils();
     socket     = client;
     socket.Start();
     socket.OnReceive += RdtReceive;
     StartDumbTimer(cts.Token);
 }
Exemplo n.º 4
0
        public Rdt30(VirtualSocket client) : base()
        {
            socket = client;
            rdt    = new RdtUtils();
            socket.Start();

            timer         = new System.Windows.Forms.Timer();
            timer.Enabled = false;

            socket.OnReceive += RdtReceive;
        }
Exemplo n.º 5
0
 //protected byte[][] buffer;
 public Rdt22(VirtualSocket client) : base()
 {
     socket = client;
     rdt    = new RdtUtils();
     socket.Start();
     state                  = (int)STATE22.wait0r;
     socket.OnReceive      += RdtReceive;
     previouslySentDatagram = null;
     seq = 0;
     //buffer = new byte[2][];
     timer         = new System.Windows.Forms.Timer();
     timer.Enabled = false;
 }