View on GitHub

P2pchat

distributed group chat system

Download this project as a .zip file Download this project as a tar.gz file

p2pChat:

Course project for cis505 spring 2012. This is a distributed chatting system with centralized sequencer and master election procedure to handle central sequencer failure. The system uses only linux kernel APIs.

Demo video

http://youtu.be/i1kwe_XM91w

Compile:

under project root:

$ mkdir build

$ cd build

$ cmake ..

$ make

There will be two executable under build/ groupchat: binary for this app unitTests: unit test cases

How to run (test scenarios):

Machine1: $ ./groupchat Bob

Machine2: $ ./groupchat Alice <hostname or IP of Machine1>:<port number>

Machine3: $ ./groupchat John <hostname or IP of Machine1>:<port number>

Machine4: $ ./groupchat Einstein <hostname or IP of Machine3>:<port number>, join indirectly to master

... do a little bit of chatting on each Machine....

Machine2: $ ctrl-c, kill the program, should be able to see the leave notice on all the rest on machines

Machine3: $ ctrl-c, kill the program, should be able to see the leave notice on all the rest on machines

Machine2: $ ./groupchat Alice <hostname or IP of Machine4>:<port number>, join again

Machine3: $ ./groupchat John <hostname or IP of Machine1>:<port number>, join again

... do a little bit of chatting on each Machine....

Machine1: $ ctrl-c, kill the program, master die, master election

... do a little bit of chatting on each Machine....

Machine3: $ ctrl-c, kill the program

Machine4: $ ctrl-c, kill the program, only Machine2 alive, elect itself to be master

Machine3: $ ./groupchat John <hostname or IP of Machine2>:<port number>

Machine4: $ ./groupchat Einstein <hostname or IP of Machine3>:<port number>

... do a little bit of chatting on each Machine....

Author:

Menglong Zhu: menglong AT cis DOT upenn DOT edu