Giter VIP home page Giter VIP logo

multi-stream-file-transfer-agent's Introduction

Multi-Stream-File-Transfer-Agent

  • This is a multistream file transfer program written in cpp using socket interface.
  • It was written by me in Nov 2015 as a part of mini-networks project.
  • The purpose of this program is to tranfer a file in multiple fragments (all in parallel) from one local computer to another connected over internet or intranet.
  • This project was successfully tested working on Ubuntu 14.04.
  • For better understanding checkout Blog on this project

Abstract

  • File can be transfered from one computer to another over the network using socket interface.
  • At the senders end file is divided into equal fragments and all fragments are sent in parallel.
  • At the receivers end every received fragment is stored in a separate file and after the file transfer is complete all the fragments are merged into single file.
  • All the fragments have .temp extension and can be found in hidden directory " .filetransfer ".
  • Fragments are not deleted for demonstration purpose.

Installation

  1. Make sure latest version of g++ is installed on your LINUX computer.
  2. If not installed run " sudo apt-get install g++ ".
  3. To transfer file make sure both computers are connected through LAN wire or to a router on a intranet or connected via internet.

To transfer a file from LINUX to another LINUX computer follow these steps

  1. Download all the files in this repository into one directory on your local LINUX computer. Make sure this directory has write and execute permissions.
  2. Know ipV4 (or inet) address of the sender by " ifconfig " or another unix command.
  3. Open " HEADERS_AND_CONSTANTS_H.h " file and edit the HOST to sender's ip address and PORT to any pre-decided port number. POST and HOST values for both sender and receiver should be same. If you are testing it on same computer set HOST to "127.0.0.1" .
  4. At sender's end compile sender file by following command g++ -o sender.out sender.cpp -std=c++11 -pthread .
  5. At receivers end compile receiver file by following command g++ -o receiver.out receiver.cpp -std=c++11 -pthread .
  6. At senders end pass an argument which denotes file path eg " sender.out file.pdf " .
  7. After running command at senders end run command at recivers end " receiver.out " .
  8. After file tranfer is complete program will terminate automatically and transfered file will be saved with the name "new" and extension will depend on the file transfered.
  9. Fragments will be in " .filetransfer/ " directory they are not deleted for demonstration purpose. you can delete them manually.

Constants & Variables

  • PORT denotes port number for server and client both.
  • HOST denotes ipV4 address of server (sender).
  • NEW_FILE denotes name by which file will be downloaded at recivers end.
  • TEMP_DIR denotes directory where file fragments are downloaded (do not change recommended).
  • TEMP_FILE denotes names of file fragments sequentially (do not change recommended).
  • MAX_STREAMS denotes maximum parallel connections to be made to the sender to download file. Also denotes number of fragments in which file will be downloaded.
  • SECONDS_TO_WAIT denotes integer seconds receiver should wait before starting to receive download header for slower connections typically less than 20kB/s value should be greater than 5.
  • FILE_NAME_LENGTH maximum characters in file name.
  • MAX_BYTES maximum size of buffer used for reading bytes from sockets.

LICENSE

multi-stream-file-transfer-agent's People

Contributors

manuchandel avatar

Watchers

Oleg 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.