Skip to content

MuhammedAbdalla/p2p-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peer-to-Peer project

My implementation of th P2P project was in command line based application. Using Python and the twisted.internet library, this application achives UDP transmission of messages without a persistent connection, or a server to central server
The architecture of this project consists of clients

Goal of the project

to be able to create a server-less messaging application using any frameworks.

- Discovery & Login
- session connection
- chat
- file exchange
- local db
- offline synch

Files

app.py
app.py was going to be a webbased implemention of the P2P application initially built in command line
client.py
client.py is contains the object class Client, which requires a username, host and port address.
currently every Client object is running on localhost, with addresses ranging from 127.0.0.1:5000 to 127.0.0.1:9998
worker.py
worker.py contains object class Worker, which runs soley to intialize Client object, return active clients from PING messages, and removing clients upon exit.

Run The Application

To run this project you need to.

  1. start the worker client by running python worker.py one terminal window
  2. start as many clients on as many terminal windows. One client per terminal python client.py
  3. Follow the instructions on the command prompt

Connecting to users

image
the command prompt will ask you to type the index the user's address is listed.

image
User address can be reloaded by inputting -1

Example Chat

image
In the example above, two clients connect and messaging each other. One client exits and returns to the connection prompt. they chose to load past conversations by inputting -2
All clients have storage for all chats with past users during their session. Chats are saved until the terminal window is closed

Worker client

image
The worker client running on 127.0.0.1:9999 is responsible for handling

  __INIT__    :    Initialize Client objects with username, host, port
  __PING__    :    Return username to worker client to indicate client is alive 
  __RELOAD__  :    Invoked by the web page to refresh all connections by pinging clients, 

About

EC530 Peer-to-Peer mini-project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published