GithubHelp home page GithubHelp logo

chat_server's Introduction

README.txt

a) A brief description of my code:
My code runs as it should. When a user connects to a server, they will be 
prompted for a username. They will get reprompted over and over again until
they input a valid username. Then they will have three attempts to type 
the correct password. The rest of the program runs as described in the code.
I set it up so that after a certain while, an idle user will get logged out
and free up the username. 

b) Details about development environment
The environment I used was python and the method on multithreading and 
handling multiple users was from the python Documentation page. I imported
the socket library, select library, and standard library.

c) Instructions on running the code
Since this code is in Python, there is no need for a makefile. To run the
server, simply type "python Server.py <portnumber>. The IP address of the
server is now set to localhost but that can easily be changed later. The
client is run the similarly by typing "python Client.py <ServerIP> <portnumber>
where the servip matches the IP Address of the Server and the port number is
the same one as the one the Server is using. 

d) Sample code to run code:

Server Side
python Server.py 4119      

Client side

python Client.py localhost 4119

#Implementation of login:

>Username: columbia
>Username: Columbia
>Password: 116bwa
>Password: 116bways
>Password: 114broadway
>Too many failed attempts
>Username: SEAS
>Password: winterbreakisover
>Welcome to simple chat server!
>whoelse
>The current connected users are:
facebook
>wholasthr
>Users that connected in the last hour are:
facebook
Google
>block facebook
You have successfully blocked facebook from sending you messages
>unblock facebook
You have successfully unblocked facebook from sending you messages
>broadcast HI facebook!
>message facebook Hey man you there?
logout

e) Additional functionalities

The private messaging implementation makes it so that it can infinitely keep
track of all the messages that people send. So five different users can send
10 messages to an offline user and he will recieve all of them when he logs
back in

additional commands:

howlong:
I created a "howlong" function that works very similarly to who else
but instead tells you how long a user had been online for (ever since 
log in).

boldmessage:
This works exactly the same way as message but it will bold the whole messag
for you. NOTE THIS ONLY WORKS IN TERMINAL

boldbroadcast:
This works exactly the same as broadcast but it will bold the whole message
for you. NOTE THIS ONLY WORKS IN TERMINAL



chat_server's People

Contributors

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