Giter Site home page Giter Site logo

multi-client-chat-server's Introduction

Multi-Client-Chat-Server

This repository contains code for implementing Multi client chat Server.

1. Connection Establishment:

The client should send the connection request to server.The server should reply client with appropriate messages if connection can be established or not.

Successful:

  If the connection can be established successfully,then generate appropriate identifiers for the client and store them at server.Identifiers includes Unique Id(5 Digit Random Number).After connection is established,send client the above details with a welcome message.

Unsuccessful :

If the number of clients connected are already 5 then no further client is allowed to connect and server should inform client that “Connection Limit Exceeded !!”.

Client details table:

Keep the details in shared memory.Use synchronization while reading and writing into the memory.

2. Data Transfer Phase:

Client should send a query message to server asking the details of online clients.Server should send the details of all the online clients [each with unique key].After receiving details, client can transfer messages to any other client of choice by using its unique id. (Note that this is a one to one communication).

Message info table:

Create another shared table which stores message details.
There can be a situation when a client A gets the list of online clients and before it can send any message to client B, client B goes offline.The sender in this case should be notified that client is now disconnected and that message should be discarded.

3. Connection Termination:

In order to disconnect, the client should send an EXIT message to the server.The server should notify all other clients with the details of client which is going to disconnect. Then terminate the client process.

4. Broadcast:

Aclientshouldbeabletosendabroadcastmessagebytyping“/broadcast”.The message should be delivered to all clients connected to the server.5.GroupFormation:​Inthispart,aclientshouldbeabletomakeagrouphavinguniqueidwithavailableactivemembers(max​5inagroup).Twobasicparadigmsthathavetobeimplemented are:a.Withoutpermissionofothermembers:​Theclientshouldbeabletomakeasimplegroupbytyping”/makegroup”followedbytheclientidsofallthemembersthattheadminwanttoincludeandthememberswillbeautomaticallyjoined(makingagroup in WhatsApp).b.Withpermissionofothermembers:​Theclientshouldbeabletomakearequestofformingasimplegroupbytyping”/makegroupreq”followedbytheclientidsofallthemembersthattheadminwanttoinclude.Anotificationshouldbesenttothatspecificclientsaskingforpermissiontojointhegroup.Ifaparticularclientwantstojoin, then it may send “/joingroup” followed by group id as the response.6.Filetransfer:​Inthispart,youhavetoemulatetheprocessofFTP.Theclientshouldbeable to transfer the files either personally or to a group.Functionalities to be included:1./active​ : To display all the available active clients that are connected to the server.2./send:Tosendmessagetotheclientcorrespondingtoits unique id.3./broadcast ​: Message should be broadcasted to all the active clients.4./makegroup...:Agroupwithuniqueidwillbemade including all the mentioned clients along with the admin client.5./sendgroup​:Thesendershouldbeinthegrouptotransferthemessagetoallhispeersofthatgroup.Themessageshouldbesendtoallthepeers along with group info.6./activegroups:Todisplayallthegroupsthatarecurrentlyactiveonserverandthesender is a part of.7./makegroupreq...:Agrouphavinguniqueidshouldbemadewithcurrentlyonlytheadminclient.Therequestmessageforjoiningthegroupshouldbenotifiedtoallthespecifiedclients.Clientscanrespondto join that group.8./joingroup​:Ifthismessageissentbyaclienthavingtherequestforjoining the group, then he will be added to group immediately. 9./quit:Theclientwillberemovedfromtheserver.Thisclientwillberemovedfromall the active groups.10./activeallgroups​ : To display all the groups which are active on the server.11./joingroup:Ifthismessageissentbyaclienthavingtherequestforjoiningthegroup,thenhewillbeaddedtogroupimmediately.Otherwisearequestshouldbepassedtotheadminofthatgroupandifadminrespondstotherequestpositively then he should be joined to that group.12./sendfile<client_id>:​Thefileshouldbetransferredfromoneclienttoanotherviaserver.Toimplementthispart,filehastobeuploadedtoserverandthenthefileshouldbedownloadedtotherespectiveclientandshouldbetransparent to all the clients.13./sendfile<group_id>:​Thefileshouldbetransferredtoallthe members of that group.

multi-client-chat-server's People

Contributors

naz-mul94 avatar

Watchers

James Cloos 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.