Giter Club home page Giter Club logo

reliableudp's Introduction

ReliableUDP

Mimicking some features of TCP.

  • Implemented cumulative acknowledgment
  • Implemented sliding window
  • On the sender side, ran a thread for sending packets and a thread for receiving ACKs, used semaphores to solve race condition
  • When the receiving thread detected 3 duplicate ACKs and the sending thread was sleeping, it woke up the sending thread, enabling fast re-transmission
  • On the receiving side, used a HashMap to receive packets that might be out of order, and only wrote them into memory once a sorted set of packets forming a complete message was received
  • Set only one timer and re-transmitted only one packet that did not receive ACK at a time

Warning

  • When I wrote this program, I hadn’t read Code Complete 2, so I didn’t know that declaring too many global variables would hurt readability, don’t learn this from me!
  • At the time I didn't know that Java has a built-in log API, so I use print and file.write

reliableudp's People

Contributors

linde7777 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.