Professional Documents
Culture Documents
1 Lab Overview
1.1 Introduction
Peer-to-peer applications are a common feature of computing today. Services from BitTorrent to Skype all rely on direct client-to-client contact. In contrast, Client-Server applications have strict divisions in the functional roles each component takes, oftentimes for purposes of efficiency in resource sharing. In this programming assignment, you will be creating two versions of a simple chat application based on two of the three application architectures discussed in lecture: (1) Client-Server, and (2) Peer-to-Peer & ClientServer Hybrid. The purpose of this assignment is to get you familiarized with the architectures, understand their pros and cons, and be able to identify what type of application each architecture is appropriate for.
2 Requirements
2.1 Client-Server (45%)
For this application, you need to write a client and a server with the following requirements: The client and server must utilize TCP socket connections. The client must be able to connect to the server and obtain a list of available clients. After obtaining this list, the client must be able to connect to one other client on the list. You may want to consider displaying this list and allowing the client to choose who he/she wants to connect to.
The clients must relay text messages only through the server. That is, each client must send its message to the server (along with some identification regarding which client the message is intended for) and the server will pass along the message to the intended recipient client. You can define whatever convention you would like to indicate that a text message is complete (e.g. hitting [Enter], clicking send). Each client must send an acknowledgement to the server that a text message has been received and displayed. Once the server receives the acknowledgement, it must then send another acknowledgement to the original sender client that the text message has been received and displayed. You must also provide some way to disconnect and end the conversation. After disconnecting, the user should be able to retrieve a new copy of the servers client list and connect to a new client. The connection between the two clients must be duplex, so both clients are capable of transmitting and receiving at the same time. A GUI is not required as this is not the focus of the assignment. You can simply use the command line for input.
NOTE: It is suggested that you first get the Client-Server communication working before implementing the full Client-Server-Client model.
the peer-to-peer client). Consider having a classmate walk through your instructions on his/her own computer to ensure your programs work on an external machine and your instructions are clear. Label this section INSTRUCTIONS. (2) List any current/known limitations with your chat programs. If you do not have any limitations, state this as well. Label this section LIMITATIONS. (3) Write up a pros and cons explanation regarding the various architectures used in this assignment. For example, why might a hybrid architecture be better for a chat program than a client-server-client architecture? 2-3 paragraphs should be sufficient. Label this section ANALYSIS. (4) Include a brief written documentation of your work to allow a third party, without knowledge of your source code, to write another client that can use your server and talk to your client. Diagrams and flowcharts may be used to minimize the amount of writing you need. 1-2 pages should be sufficient in most cases. MSPaint diagrams and/or hand drawings are acceptable if legible and adequately explained. Label this section DOCUMENTATION.