Giter Site home page Giter Site logo

bittorrent's Introduction

Hey! I'm Nikhil. ๐Ÿ‘‹๐Ÿฝ

GitHub nt92 Linkedin: Nikhil Thota

๐Ÿ“ˆ Github Stats

nt92's Github Stats

nt92's GitHub Streak

bittorrent's People

Contributors

gonzalonunez avatar nt92 avatar takashiw avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bittorrent's Issues

Optimize threads with closing connections

After a thread has run its course, we should be able to close it and drop the connection so that we are not wasting space/cpu. For example, we can do this when a transfer is completed and the file is on the peer, it will not need any more outward requests so we can remove its threads looking for pieces.

Crunch Time v1

  • Choke/unchoke timer/logic (download rates etc.)
  • New Logger architecture to handle multiple peers on the same machine (so we can actually test)
  • Change Message architecture
  • Create MessageDispatcher

Messages

Details

message length message type payload
  • Message length: 4 byte field, specifies the message length in bytes
  • Message type: Specifies the type of message. See below.
  • Message payload: Variable size, varies by message type.

Message types

message type value
choke 0
unchoke 1
interested 2
not interested 3
have 4
bitfield 5
request 6
piece 7

Message payloads

To do...

Handshake

Details

handshake header zero bits peer ID
  • Handshake header: 18 byte string "P2PFILESHARINGPROJ"
  • Zero bits: 10 byte zero bits
  • Peer ID: 4 byte integer representation of the peer ID

File Handler

for a peer,

  • determine what file-pieces peer has
  • determine if peer has all file-pieces
  • save file-piece
  • compile file-pieces into complete file

FileHandler

Add functionality to FileHandler so we can utilize its data to compare/send pieces of the actual file being transferred.

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.