Git Product home page Git Product logo

chat_server's Introduction

Chat Server

Build a chat server and client to work with it.

Original Iron Forger assignment is at https://hackpad.com/Week-6-Chat-Server-Client-rIxE6ZfW1sN.

Status: Not yet working satisfactorily.

To run

Programs: server.py, client.py. These programs require at least Python 3.4.

  • The server and each client choose the port over which they communicate at random. The same seed must be supplied:

     python server.py oh_a_seed_here
     python client.py oh_a_seed_here
    

    etc. If no seed is supplied, the programs use a default seed. If the seeds used are not the same, then the client will not be able to contact the server.

Functionality currently working

  • Using Python 3.4's asyncio module and asyncio.streams.StreamReader and asyncio.streams.StreamWriter objects.
  • Multiple clients can log into the same server.
  • Each client logs in with its own log-in, and a dictionary is populated, login: (StreamReader, StreamWrite).

Currently not working

  • Although each client can communicate independently with the single server, they cannot communicate with each other. An effort is made in server2.py, client2.py to allow different clients to communicate by way of the server, but it is not working now. There seem to be two problems:

    • checking constantly for input and printing output whenever it arrives need to be separate somehow, so that they can appear to take place simultaneously;
    • in server2.py and client2.py, for some reason messages did not go to the clients I expected them to go to โ€” they went to the client that originally sent the messages.

Next

  • Implement message functionality.
  • Handle commands from the client to the server:
    • ?h: list of commands
    • ?u: list of logged-in users
    • q: quit
    • >u[, u2, ...]: message: send message to user(s) u, u2, etc.

[end]

chat_server's People

Contributors

brannerchinese avatar

Watchers

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