$39.99
Updates to the assignment, including any corrections and clarifications, will be posted on the subject website. Please make sure that you check the subject website regularly for updates.
1. Change Log
2. Goal and learning objectives
Online discussion forums are widely used as a means for large groups of people to hold conversations on topics of mutual interest. A good example is the online forum used for this course. In this assignment, you will have the opportunity to implement your own version of an online discussion forum application. Your application is based on a client server model consisting of one server and multiple clients communicating either sequentially (i.e., one at a time) or concurrently. The client and server should communicate using TCP. Your application will support a range of functions that are typically found on discussion forums including authentication, creation and deletion of threads and messages, reading threads, uploading and downloading files. However, unlike typical online forums that are accessed through HTTP, you will be designing a custom application protocol.
2.1 Learning Objectives
On completing this assignment, you will gain sufficient expertise in the following skills:
1. Detailed understanding of how online discussion forums work.
2. Expertise in socket programming.
3. Insights into designing an application layer protocol and a fully functioning networked application.
The assignment is worth 20 marks. We will test it in two distinct configurations. In the first instance, we will test the interaction between the server and a SINGLE active client. All outlined functionality will be tested. Multiple clients will connect to the server but sequentially – one client connects, interacts, exits, the second client connects, interacts, exits and so on. The first configuration is worth 14 marks (70% of the total mark). In the second instance, we will test the interaction of the server with multiple concurrent clients. All outlined functionality will be tested. The second configuration is worth 6 marks. Submissions from CSE students will be tested in both configurations. Submissions from non-CSE students will only be tested in the first configuration. The marking guidelines are thus different for the two groups and are indicated in Section 7.
3. Assignment Specification
The assignment will be tested in two configurations. In the first configuration, the server will interact with a single client at any given time. Multiple clients can connect with the server in a serial fashion, i.e., one client connects, interacts and quits, the second client connects, interacts and quits, and so on. The server design is significantly simplified (i.e. you won’t need to use multi-threading) if you only wish to implement this portion of the assignment. A correct implementation of this first part is worth 70% of the assignment marks (14 marks, see Section 7). In the second configuration, the server must interact with multiple clients concurrently. The client design will only require minimal changes to meet this requirement. The server design, however, would require a significant change, in that, the server would need to send and receive messages to and from multiple clients concurrently. We strongly recommend using multithreading to achieve this. The interaction with a single client, would however be similar as in the first configuration. Note that, a correctly implemented multi-threaded server should also be able to interact correctly with a single client at any given time. So, if you design your client and server to achieve all functionality expected for the second configuration, it should work as expected in the first configuration.
3.1 File Names & Execution
The main code for the server and client should be contained in the following files: server.c, or Server.java or server.py, and client.c or Client.java or client.py. You are free to create additional files such as header files or other class files and name them as you wish. Submission instructions are in Section 5.
The server should accept the following arguments:
• server_port: this is the port number which the server will use to communicate with the clients. Recall that a TCP socket is NOT uniquely identified by the server port number. It should thus be possible for multiple TCP connections to use the same serverside port number (in Part 2).
• admin_passwd: this is the admin password for the server. It is required to shut down the server (see operation SHT later).
The server should be executed before any of the clients. It should be initiated as follows:
If you use Java:
java Server server_port admin_passwd
If you use C:
./server server_port admin_passwd
If you use Python:
python server.py server_port admin_passwd OR python3 server.py server_port admin_passwd
The client should accept the following two arguments:
• server_IP: this is the IP address of the machine on which the server is running.
• server_port: this is the port number being used by the server. This argument should be the same as the first argument of the server.
Note that, you do not have to specify the port to be used by the client. You should allow the OS to pick a random available port. Each client should be initiated in a separate terminal as follows:
If you use Java:
java Client server_IP server_port
If you use C:
./client server_IP server_port
If you use Python:
python client.py server_IP server_port OR python3 client.py server_IP server_port
Note: When you are testing your assignment, you should run the server and one or more clients on the same machine in separate terminals. In this case, use 127.0.0.1 (local host) as the server IP address.
3.2 Authentication
Upon execution, a client should first attempt to setup a TCP connection with the server. Assuming the connection is successful, the client should prompt the user to enter a username. The username should be sent to the server. The server should check the credentials file (credentials.txt) for a match. If the username exists, the server sends a confirmation message to the client. The client prompts the user to enter a password. The password is sent to the server, which checks for a match with the stored password for this user. The server sends a confirmation if the password matches or an error message in the event of a mismatch. An appropriate message is displayed to the user. In case, of a mismatch, the client prompts the user to enter a username. If the username does not exist, the sever sends an appropriate message to the client. The client prompts the user to enter a new password. The password is sent to the server. The server creates a new username and password entry in the credentials file (appending it as the last entry in the file). A confirmation is sent to the client. The client displays an appropriate message to the user. You should make sure that write permissions are enabled for the credentials.txt file (type “chmod +w credentials.txt” at a terminal in the current working directory of the server).
When your assignment is tested with multiple concurrent clients, the server should also check that a new client that is authenticating with the server does not attempt to login with a username that is already being used by another active client (i.e. a username cannot be used concurrently by two clients). The server should keep track of all active users and check that the username provided by an authenticating client does not match with those in this list. If a match is found, then a message to this effect should be sent to the server and displayed at the prompt for the user and they should be prompted to enter a username.
3.3 Discussion Forum Operations
Following successful login, the client displays a message to the user informing them of all available commands and prompting to select one command. The following commands are available: CRT: Create Thread, LST: List Threads, MSG: Post Message, DLT: Delete Message, RDT: Read Thread, EDT: Edit Message, UPD: Upload File, DWN: Download File, RMV: Remove Thread, XIT: Exit, SHT: Shutdown Server. All available commands should be shown to the user in the first instance after successful login. Subsequent prompts for actions should include this same message.
If an invalid command is selected, an error message should be shown to the user and they should be prompted to select one of the available actions.
If the user does not follow the expected usage of any of the operations listed below, i.e., missing (e.g., not specifying the title of the thread when creating a thread) or incorrect number of arguments (e.g., inclusion of additional or fewer arguments than required) , an error message should be shown to the user and they should be prompted to select one of the available commands. Section 8 illustrates sample interactions between the client and server.
There are 11 commands that users can execute. The execution of each individual command is described below.
CRT: Create Thread
CRT threadtitle
MSG: Post Message
MSG threadtitle message
messagenumber username: message
An example:
1 yoda: do or do not, there is no try
A confirmation message should be sent to the server and displayed to the user. If the thread with this title does not exist, an error message should be sent to the client and displayed at the prompt to the user. The client should next prompt the user to select one of the available commands.
DLT: Delete Message
DLT threadtitle messagenumber
The title of the thread from which the message is to be deleted and the message number within that thread to be deleted should be included as arguments. A message can only be deleted by the user who originally posted that message. The client sends the command (DLT), the title of the thread, the message number and the username to the server. The server should check if a thread with this title exists and if the corresponding message number is valid and finally if this user had originally posted this message. In the event that any of these checks are unsuccessful, an appropriate error message should be sent to the client and displayed at the prompt to the user. If all checks pass, then the server should delete the message, which entails deleting the line containing this message in the corresponding thread file (all subsequent messages in the file should be moved up by one line and their message numbers should be updated appropriately) and a confirmation should be sent to the client and displayed at the prompt to the user. The client should next prompt the user to select one of the available commands.
EDT: Edit Message
EDT threadtitle messagenumber message
The title of the thread from which the message is to be edited, the message number within that thread to be edited and the new message should be included as arguments. A message can only be edited by the user who originally posted that message. The client should send the command (EDT), the title of the thread, the message number, the new message and the username to the server. The server should check if a thread with this title exists and if the corresponding message number is valid and finally if the username had posted this message. In the event that any of these checks are unsuccessful, an appropriate error message should be sent to the client and displayed at the prompt to the user. If all checks pass, then the server should replace the original message in the corresponding thread file with the new message (the rest of the details associated with this message, i.e. message number and username should remain unchanged) and a confirmation should be sent to the client and displayed at the prompt to the user. The client should next prompt the user to select one of the commands.
LST: List Threads
LST
There should be no arguments for this command. The client sends the command (LST) to the server. The server replies back with a listing of all the thread titles. Only the thread titles should be listed, not the messages. The client should print the list on the terminal (one thread per line). If there are no active threads, then a message to that effect should be displayed at the prompt to the user. The client should next prompt the user to select one of the available commands.
RDT: Read Thread
RDT threadtitle
The title of the thread to be read should be included as an argument. The client should send the command (RDT) and the title of the thread to be read to the server. The server should check if a thread with this title exists. If so, the server should send the contents of the file corresponding to this thread (excluding the first line which contains the username of the creator of the thread) to the client. The client should display all contents of the file including messages and information about uploaded files (see next action) at the terminal to the user. If the thread with this title does not exist, an error message should be sent to the client and displayed at the prompt to the user. The client should next prompt the user to select one of the available commands.
UPD: Upload file
UPD threadtitle filename
Username uploaded filename
The entries for file uploads cannot be edited using the EDT command or deleted using the DLT command. They should however be included when a thread is read using the RDT command. Finally, the server should send a confirmation message to the client and a message to this effect should be displayed at the prompt to the user. The client should next prompt the user to select one of the available commands.
DWN: Download file
DWN threadtitle filename
TESTING NOTES: (1) When you test the operation of this command, you will likely first upload a test file from the client to the server using the previous command UPD and then try to download the same file from the server using the DWN command. You should make sure that you remove this file from the current working directory of the client between these two commands (to be consistent with the assumption stated in the description above). You can do this by opening a separate terminal and deleting this file from the client’s working directory. (2) For similar reasons, when testing your program under the second configuration, make sure that the multiple clients are executed in different working directories.
RMV: Remove Thread
RMV threadtitle
The title of the thread to be removed should be included as an argument with this action. A thread can only be removed by the user who originally created that thread. The client should send the operation (RMV), the title of the thread and the username to the server. The server should first check if a thread with this title exists and if so, whether the user who created the thread matches with the provided username. If either check doesn’t match, then an error message should be sent to the client and displayed at the terminal to the user. Else, the thread is deleted including the file storing information about the thread, any files uploaded to the thread and any state maintained about the thread at the server. A confirmation message should be sent to the client which is displayed at the prompt to the user. The client should next prompt the user to select one of the available actions.
XIT: Exit
XIT
There should be no arguments for this command. The client should close the TCP connection and exit with a goodbye message displayed at the terminal to the user. The server should update its state information about currently logged on users. Note that, any messages and files uploaded by the user must not be deleted.
SHT: Shutdown
SHT admin_password
The admin password should be provided as the argument. The client should send the command (SHT) and the admin password to the server. Note that, the admin password is provided to the server as the second command line argument during execution. It is NOT included in the credentials file. The server should check the provided password against the admin password. If the passwords do not match, then an error message should be sent to the client and displayed at the prompt to the user. The client should next prompt the user to select one of the available actions. If the passwords match, then the server should initiate shutdown process. This includes sending a shutdown message to all active clients (in the case when we are testing with multiple concurrent clients). Each client will display an appropriate message at the terminal to the user indicating that the discussion forum is shutting down and close the socket. The server should delete all files that were (only) created by the server program in the current working directory including files for all active threads and any files uploaded to the threads and the credentials file. The client need not delete any files in the current working directory. All sockets should be closed.
3.3 Program Design Considerations
Transport Layer
You MUST use TCP for this assignment. This ensures that your client and server programs do not have to worry about reliable delivery of messages to each other. The use of UDP is likely to attract a heavy penalty.
Client Design
The client program should be fairly straightforward. The client needs to interact with the user through the command line interface and print meaningful messages. Section 8 provides some examples. You do not have the use the exact same text as shown in the samples. Upon initiation, the client should establish a TCP connection with the server and execute the user authentication process. Following authentication, the user should be prompted to enter one of the available commands. Almost all commands require simple request/response interactions between the client with the server. Note that, the client does not need to maintain any state about the discussion forum.
Server Design
4. Additional Notes
• This is NOT group assignment. You are expected to work on this individually.
• Tips on getting started: The best way to tackle a complex implementation task is to do it in stages. We recommend that you first implement the functionality for the first configuration, i.e., the server interacts with a single active client at any time. A good place to start would be to implement the functionality to allow a single user to login with the server. Next, add functionality to implement one command. Ensure you thoroughly test the operation of each command, including typical error conditions, and then progress to the next. We recommend that you start with the simpler commands such as CRT, MSG, LST before progressing to more complex commands such as UPD and DWN. Once you have thoroughly tested your code for the first configuration, proceed to the second configuration. It is imperative that you rigorously test your code to ensure that all possible (and logical) interactions can be correctly executed. Test, test and test.
• Transport Layer Protocol: You should use TCP for transferring messages between each client and server. The TCP connection should be setup by the client on initiation and should remain active until the user exits or one of the other concurrently connected users initiates shutdown (only in the second configuration). The server port is specified as a command line argument. The client port does not need to be specified. Your client program should let the OS pick a random available port.
• There is no requirement that you must use the same text for the various messages displayed to the user on the terminal as illustrated in the examples in Section 8. However, please make sure that the text is clear and unambiguous.
• You are strongly encouraged to use the course forum on WebCMS to ask questions and to discuss different approaches to solve the problem. However, you should not post your solution or any code fragments on the forums.
• We will arrange for additional consultations in Weeks 7-10 to assist you with assignment related questions. Information about the consults will be announced via the website.
5. Submission
You are required to submit your source code and report.pdf. You can submit your assignment using the give command through VLAB. Make sure you are in the same directory as your code and report, and then do the following:
1. Type tar -cvf assign.tar filenames
e.g. tar -cvf assign.tar *.java report.pdf
2. When you are ready to submit, at the bash prompt type 3331
3. Next, type: give cs3331 Assign assign.tar (You should receive a message stating the result of your submission). The same command should be used for 3331 and 9331.
Alternately, you can also submit the tar file via the WebCMS3 interface on the assignment page.
Important Notes
• The system will only accept assign.tar submission name. All other names will be rejected.
• 5 or more days late: NOT accepted
NOTE: The above penalty is applied to your final total. For example, if you submit your assignment 1 day late and your score on the assignment is 10, then your final mark will be 10 – 1 (10% penalty) = 9.
7. Marking Policy
Functionality Marks (CSE) Marks
(NonCSE)
Successful authentication for an existing and new user including all error handling 1 1.5
Successful creation of a new thread (CRT command) including all error handling 1 1.5
Successful creation of a new message (MSG command) including all error handling 1 1.5
Successful listing of active threads (LST command) including all error handling 0.5 0.75
Successful reading of an active thread (RDT command) including all error handling 1 1.5
Successful editing of an existing message (EDT command) including all error handling 1 1.5
Successful deletion of an existing message (DLT command) including all error handling 1 1.5
Successful deletion of an active thread (RMV command) including all error handling 1 1.5
Successful uploading of a file to a thread (UPD command) including all error handling 1.5 2.25
Successful download of a file from a thread (DWN command) including all error handling 1.5 2.25
Successful log off for a logged in user (XIT command) including all error handling 0.5 0.75
Successful shutdown of the server (SHT command) including all error handling 1 1.5
Properly documented report 1 1
Code quality and comments 1 1
Successful authentication of multiple concurrent existing and new users including all error handing 0.5 N/A
Successful execution of all 11 commands and associated error handling (11 x 0.5 marks each) 5.5 N/A
NOTE: While marking, we will be testing for typical usage scenarios for the above functionality and some straightforward error conditions. A typical marking session will last for about 15-20 minutes. When testing with multiple concurrent clients, we will spawn a maximum of 3 concurrent clients. However, please do not hard code any specific limits in your programs. We won’t be testing your code under very complex scenarios and extreme edge cases.
8. Sample Interaction
In the following we provide examples of sample interactions for both configurations to be tested. Your server and client code should display similar meaningful messages at the terminal. You do not have to use the same text as shown below. Note that, this is not an exhaustive summary of all possible interactions. Our tests will not necessarily follow this exact interaction shown.
First Configuration
In this configuration, the server interacts with a single client at any given time. It is recommended to execute the client and server in different working directories. Ensure that write permissions are enabled on the credentials file. In the following, two clients with usernames Yoda and Obiwan connect and interact with the server sequentially in that order. The inputs from the user are shown as underlined in the client terminal. Extra spacing is inserted in the server terminal to align the output with corresponding user interaction at the client end.
Client Terminal Server Terminal
>java Client 127.0.0.1 5000
Enter username: Yoda
Enter password: sdrfdfs12
Invalid password
Enter username: Yoda
Enter password: jedi*knight
Welcome to the forum
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: LST
No threads to list
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: HELLO
Invalid command
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: CRT 3331
Thread 3331 created
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: CRT 3331
Thread 3331 exists
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: CRT 9331
Thread 9331 created
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, >java Server 5000 destroyforum
Waiting for clients
Client connected
Incorrect password
Yoda successful login
Yoda issued LST command
Yoda issued CRT command
Thread 3331 created
Yoda issued CRT command
Thread 3331 exists
Yoda issued CRT command
Thread 9331 created
XIT, SHT: LST 3331
Incorrect syntax for LST
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: LST
The list of active threads:
3331
9331
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: MSG 3331 Networks is awesome
Message posted to 3331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT
Incorrect syntax for RDT
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT 9331
Thread 9331 is empty
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT 3331
1 Yoda: Networks is awesome
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: UPD 3331 test.exe test.exe uploaded to 3331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT 3331
1 Yoda: Networks is awesome
Yoda uploaded test.exe
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RMV 9331
Thread 9331 removed
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: XIT
Goodbye
>java Client 127.0.0.1 5000
Enter username: Obi-wan
Enter new password for Obi-wan: r2d2
Enter one of the following commands: CRT,
Yoda issued LST command
Yoda issued MSG command
Message posted to 3331 thread
Yoda issued RDT command
Thread 9331 read
Yoda issued RDT command
Thread 3331 read
Yoda issued UPD command
Yoda uploaded file test.exe to
3331 thread
Yoda issued RDT command
Thread 3331 read
Yoda issued RMV command
Thread 9331 removed
Yoda exited
Waiting for clients
Client connected
New user
Obi-wan successfully logged in
MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: CRT 9331
Thread 9331 created
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: MSG 9331 Networks exam PWNED me
Message posted to 9331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: MSG 3331 Networks exam PWNED me
Message posted to 3331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: LST
The list of active threads:
3331
9331
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT 331
Thread 331 does not exist
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT 3331
1 Yoda: Networks is awesome
Yoda uploaded test.exe
2 Obi-wan: Networks exam PWNED me
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: DWN 9331 test.exe
File does not exist in Thread 9331
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: DWN 3331 test.exe test.exe successfully downloaded
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: EDT 3331 1 I PWNED Networks exam
The message belongs to another user and cannot be edited
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: EDT 3331 2 I PWNED Networks exam
The message has been edited
Enter one of the following commands: CRT,
Obi-wan issued CRT command
Thread 9331 created
Obi-wan issued MSG command
Obi-wan posted to 9331 thread
Obi-wan issued MSG command
Obi-wan posted to 3331 thread
Obi-wan issued LST command
Obi-wan issued RDT command
Incorrect thread specified
Obi-wan issued RDT command
Thread 3331 read
Obi-wan issued DWN command test.exe does not exist in Thread 9331
Obi-wan issued DWN command test.exe downloaded from Thread 3331
Obi-wan issued EDT commend
Message cannot be edited
Obi-wan issued EDT commend
Message has been edited
MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RDT 3331
1 Yoda: Networks is awesome
Yoda uploaded test.exe
2 Obi-wan: I PWNED Networks exam
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: RMV 3331
The thread was created by another user and cannot be removed
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: RMV 9331
The thread has been removed
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: LST
The list of active threads:
3331
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: SHT
Incorrect syntax for RDT
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: SHT monkey
Incorrect password
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV,
XIT, SHT: SHT destroyforum
Goodbye. Server shutting down
>
Obi-wan issued RDT command
Thread 3331 read
Obi-wan issued RMV command
Thread 3331 cannot be removed
Obi-wan issued RMV command
Thread 9331 removed
Obi-wan issued LST command
Obi-wan issued SHT command
Incorrect password
Obi-wan issued SHT command
Server shutting down
>
Second Configuration
In this configuration, the server interacts concurrently with multiple clients. In the following, two clients with usernames Yoda and R2D2 connect and interact with the server concurrently. The inputs from the user are shown as underlined. It is strongly recommended to execute the sever and each individual client in a separate working directory. Ensure that write permissions are enabled on the credentials file.
Note that, extra space is added in the two client terminals to simulate some delay before the users enter commands when prompted to do so. This is simply done to improve readability of the output below. You should not make such assumptions in your implementation.
Client 1 Terminal Client 2 Terminal Server Terminal
>java Client 127.0.0.1 6000
Enter username: Yoda
Enter password: jedi*knight
Welcome to the forum
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
LST
No threads to list
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
CRT 3331
Thread 3331 exists
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN,
RMV, XIT, SHT: CRT 9331 Thread 9331 created
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: MSG 3331 Networks Rocks!
Message posted to 3331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
>java Client 127.0.0.1 6000
Enter username: Yoda
Yoda has already
logged in
Enter username: R2D2
Enter password:
c3p0sucks
Welcome to the forum
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s
response)
CRT 3331
Thread 3331 created
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
MSG 3331 Yes it does
Message posted to 3331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, >java Server 6000 destroyforum Waiting for clients
Client connected
Yoda successful login
Client connected
Yoda has already
logged in
R2D2 successful login
Yoda issued LST
command
R2D2 issued CRT
command
Thread 3331 created
Yoda issued CRT command
Thread 3331 exists
Yoda issued CRT command
Thread 9331 created
Yoda issued MSG command
Message posted to
3331 thread
R2D2 issued MSG
command
Message posted to
3331 thread
UPD 9331 test1.exe test1.exe uploaded to 9331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
RDT 9331
Yoda uploaded test1.exe
R2D2 uploaded test2.exe
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
EDT 3331 2 This assignment rocks
The message belongs to another user and cannot be edited
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: MSG 3331 This assignment rocks
Message posted to 3331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
LST, RDT, UPD, DWN, RMV, XIT, SHT: RDT 3331
1 Yoda: Networks
Rocks!
2 R2D2: Yes it does
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
UPD 9331 test2.exe test2.exe uploaded to 9331 thread
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s
response)
DWN 9331 test1.exe test1.exe successfully downloaded
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s
response)
RDT 3331
1 Yoda: Networks Rocks!
R2D2 issued RDT command
Thread 3331 read
Yoda issued UPD command
Yoda uploaded file test1.exe to 9331 thread
R2D2 issued UPD
command
R2D2 uploaded file test2.exe to 9331 thread
Yoda issued RDT
command
Thread 9331 read
R2D2 issued DWN
command test1.exe downloaded from Thread 9331
Yoda issued EDT command
Message cannot be edited
Yoda issued MSG
command
Message posted to
3331 thread
R2D2 issued RDT
command
(extra space added before user’s response)
DLT 3331 2
The message belongs to another user and cannot be edited
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT: DLT 3331 1
The message has been
deleted
Enter one of the following commands: CRT, MSG, DLT, EDT, LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
SHT destroyforum
Goodbye. Server shutting down > 2 R2D2: Yes it does
3 Yoda: This assignment rocks
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
(extra space added before user’s response)
RDT 3331
1 R2D2: Yes it does
2 Yoda: This assignment rocks
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT: RMV 9331
Thread cannot be
removed
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT: RMV
3331
Thread removed
Enter one of the following commands: CRT, MSG, DLT, EDT,
LST, RDT, UPD, DWN, RMV, XIT, SHT:
Goodbye. Server
shutting down
>
Thread 3331 read
Yoda issued DLT
command
Message cannot be deleted
Yoda issued DLT
command
Message has been
deleted
R2D2 issued RDT
command
Thread 3331 read
R2D2 issued RMV
command
Thread 9331 cannot be removed
R2D2 issued RMV command
Thread 3331 removed
Obi-wan issued SHT command
Server shutting down
>