Git Product home page Git Product logo

coen366_p2p's Introduction

READ ME- Final Project

Luca Tomassi

for COEN366: Networking & Protocols

Simple File Transfer Service

The content of the application reside on two seperate folders as can be seen below.

image

Each folder can hold distinct files of any type, .pdf, .png, .txt, pptx as seen below.

image

Contents of /client folder

image

Contents of /server folder

Folders in the /client folder, can be transfered to the server side via the put command, and clients in the /server folder, can be transfered to the client side via the get command. Additionally, any file can be renamed using the change command.

Server-Side

The /server folder holds s.py, which is the server program,

In order to start the program, and start the server, in the CLI, you must first cd into the appropriate directory, once there, one can simply run the following command:

python s.py 2000 0

This command will run the program, giving it the parameters below:

  • Port: 2000
  • Debug Flag: 0

Note that the debug flag is initially set to 0, if the program is ran with the same line, but a 1 instead of a 0, this will enter debug mode, where each request/response will have a message associated to it, as per the rescode/mnemonic given in the tables.

Once initialized, the server will listen for any incoming connections, and only accept the connection when the appropriate IP address/Port Number have been entered by a Client.

Client-Side

The /client folder holds c.py which is the client program,

In order to start the program in the CLI, you must first cd into the appropriate directory,

once there, one can simply run the following command:

python c.py 127.0.0.1 2000 0

This command will run the program, giving it the parameters below:

  • IP: 127.0.0.1
  • Port: 2000
  • Debug Flag: 0

Note that the debug flag is initially set to 0, if the program is ran with the same line, but a 1 instead of a 0, this will enter debug mode, where each request/response will have a message associated to it, as per the rescode/mnemonic given in the tables.

Running this command will start the Client, connecting it to the server which has the matching IP address/ Port Number.

Once both sides have been initialized, the Client side will be waiting for the user to input commands, where the user commands are listed as below:

  • put filename : Transfers a file, from the client to the server.
  • get filename : Fetches a file, from the server to the client.
  • change oldfilename newfilename : Renames an existant file to a new given name
  • help : Lists all available commands (listed above)
  • bye : Exits the Client/Server

Debug-Mode ( debug flag set to 1 )

In the case that a user wants to debug the application, the debug flag parameter can be initially set to 1.

Doing so will allow the Request Messages to look as follow:

image

And the Response Messages will be as:

image

coen366_p2p's People

Contributors

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