Code Monkey home page Code Monkey logo

peertopeer's Introduction

PeerToPeerApp

About

Peer2Peer is a simple application built using socket programming in C++ which is capable of transferring files over TCP. Since TCP is used file verification(hashing) is not considered.

Design

The P2P communication is achieved by two threads running under a main thread. One thread acts as a server and other thread acts as a client running under a single process. Thus if a new process is started it can communicate with each other. The hostname and port is needed to make the connection.

Major Files:

P2Pmain.cpp: The main startup file, resposible to create two threads.

PeerReceiver.cpp The peer receiver or the server thread, resposible to accept and provide files to other peers.

PeerSender.cpp The peer sender or the client thread, resposible to connecte to other peers and give commands to download specific file.

OutPutLog

In the ReadMe.doc

Compilation

Go to the Debug folder and run make all to compile make clean to clean

How To Test:

A sample test is provided under the β€œTest” folder. The Test directory contains a simple structure of a P2P setup with 2 peers, Peer1 and Peer2. Each of them have a shared directory named, shared. Each of them have a executable named PeerToPeer which can be used to create a connection between each other.

Environment/Tools:

A Linux ubuntu desltop: Linux 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Compiler : C++14 Editor: Eclipse

Limitation:

The compiler warnings need to be fixed Error and Exception handling can be improved More test case and different file format need to be tested. Unit test case addition

peertopeer's People

Contributors

mitrapinaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

peertopeer's Issues

Cant send bigger files or other filetype

When trying to send a bigger text file it will truncate it to the first part only of the file and if you try sending a zip for example it ends up like a text file.

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.