Home Schedule Reading Projects People
Mac Logo Windows Logo Minix Logo Sun Solaris Logo Linux Logo

Project 3: CHATTY - A Client / Server Chatt Room.

Assignment Day September 14, 2010 (Tuesday)
Due Date September 23, 2010 (Thursday)

Collaboration Policy - Read Carefully

You may work on this project in teams of two or individually. You may discuss this assignment with other students and groups in the class and ask and provide help in useful ways, preferable over our email list so we can all benefit from your great ideas. You may consult (but not copy) any outside resources including books, papers, web sites and people (but no penguins or sea urchins).

If you use resources other than the class materials, indicate what you used along with your answer.

You have probably guessed it by now - every project will have a similar paragraph to the one above but with slight variations, of-course.

Objective:

The goal of this project is to introduce you to the concepts of processes and inter-process communication.

The project is purposely loosely defined so there are opportunities for you to be creative and hopefully have fun. Please share ideas on the email list - I always enjoy hearing what you are working on.

The general idea is to implement a client / server chat room. The chat needs to support multiple clients - i.e., multiple chatters and one server that relay messages to the other chatter clients.

Key Concepts and Goals:

Tutorial / References

Socket Programming Resources:

Beej's Guide to Network Programming:
http://www.ecst.csuchico.edu/~beej/guide/net/

Jim Frost Guide to Socket Programs:
http://world.std.com/~jimf/papers/sockets/sockets.html

Jeff Donahoo's Code/Book:
http://cs.ecs.baylor/~donahoo/practical/CSockets

C programming/tutorials:

There are several C resources on the net. Here are some that may be useful:

http://www.strath.ac.uk/IT/Docs/Ccourse/

http://www.lysator.liu.se/c/bwk-tutor.html

GDB (GNU Debugger) tutorial:
http://arioch.unomaha.edu/~jclark/gdb_plus.html

C Frequently Asked Questions:
http://www.eskimo.com/~scs/C-faq/top.html

If you find other resources please post links on the mailing list for the class.

 

Design of Chat Server / Client Project:

You will write two programs a server that both waits for client connection and relay messages to connected clients and a chat client that connects to the chat server at a specific port. This project is open ended and you can design it however you like (: so this project is for the adventures. Also - you may discuss and are encouraged to discuss your project / design on the class email list.

 

What is a Chat Room?

Some of you may be familiar with some forms of Chat Rooms over the Internet such as Instant messenger, Skype, talk and more. For this assignment assume a chat room is created by a server, the server allows the creation of different chat rooms identified by a host name and port number. People can "subscribe to" or "enter" a chat room. A client can send messages, and they instantly appear on the screens of everyone else in the room.

You will be given C-code for an echo server and a client where the server echos back strings from a client. Your project is to extend the server and client to a Chat Room application.

A Possible Sequence of Events (you may deviate from this):

An possible sequence of events between a server and a client is listed below.

1. start server on server machine with specified port number:

chat-server 127.0.0.1 5000


2. start client on client machine

chat-client 127.0.0.1 5000


3. client, Jane, connects to the server(via chat-client program).
4. User Jane (client code) types a text to server

Example:
'Hello this is Jill!'

6. Server echos back the text to other connected clients preceded by the name of the original client.

Jill said> 'Hello this is Jill!'


8. The client closes the connection by sending 'bye'

9. The server notes other connected clients:

Jill has left the chat room>

 

Client Server Interaction:

Your server should be able to accept multiple connections (from different hosts). It should be able to simultaneously listen for incoming connections as well as keep reading from connections that are already open.

Since many of the calls that we talked about in class are blocking calls (e.g. accept(), recv()). They may stall the program execution until data arrives. For example if your server is blocking on an accept() it cannot receive data at the same time.

There are several solutions to this problem. One solution is to use multiple processes (using fork()), another is to use threads (using pthreads)

There are two example programs of multitasking servers in the project3 directory (see this link) - one is called TCPEchoServer-Fork.c and is listed under the subdirectories echo, the other is listed under the subdirectory pong (last semester's project). Makefiles/README.txt for the echo server.

Design Decisions:

You need to design how the server knows how lines are terminated. You do need to design communication for high performance.

Submitting:

You need to name the directory of your source code "project3/". You must to include a README.txt file describing how to run and compile your program. You also need to include a Makefile, you can find an example makefile in the subdirectories of the project3 directory accessible from the schedule web page.

  1. Create a directory project3
  2. Put all the materials needed in the above directory (including your README.txt file)
  3. Submit via the 'submit' command (while on odin.cs.uga.edu)

    {odin:maria} submit project3 csx730

    ** odin 'submit' is expected to work by project deadline worst case we will accept submission on atlas.

Optional:

 

Grading Criteria (stay tuned):