--------------------------------------------------------------------------- Assignment 1: 433-652 Name: Multi-Threaded Dictionary Server: Design and Implementation of a Simple Multi-Threaded Distributed System Supporting Access to a Remote Dictionary AIM: (1) To Enhance Understanding of Socket Programming and Multi-Threading (2) Gain experience in implementing a simple distributed, client server application. Submission Deadline: March 21, 2005 Demo Day: March 21, 2006 (12-2pm in TA's Room) Total Marks: 10 --------------------------------------------------------------------------- Problem: ******** Using a client-server architecture, design and implement a multi-threaded server that returns the meaning of a word as stored in a dictionary. Below are some guidelines for basic/simple implementation, but you are welcome to use your own judgment to implement an advanced version that demonstrates various aspects of distributed systems and applications. Program Logic: ************** 1)Client Interface/API: The client should implement a function/method with the prototype: boolean DictionarySearch(string A, string B) The first parameter represents a word whose meaning we are knowing. If the word is found in the dictionary, the function returns TRUE, otherwise FALSE. If the return value is TRUE, than string B contains the meaning of word A. The function/method may be invoked as follows: status = DictionarySearch("King", Meaning) If client interface is OO/Java based, then it will look something like: status = RemoteDictionary.DictionarySearch("King", Meaning) A call to this function would result in the client opening a socket connection with the server, transmitting the parameters and then waiting for the result from the server. The result which is received as string can be printed as its meaning. The design of internal protocols for communication between the client and server is left for the students to decide. ------------- For Java-based implementationm you can use the following method prototype: String DictionarySearch(String A) which returns the meaning, and returns null if word A is not found. ------------- 2)Server: The server should listen for connections on a port number supplied as command line argument. For example, we can start the server as follows: % java DictServer 4500 (where 4500 is a port number) When a connection is received from the client, the server should start a new thread to deal with the client, receive the parameters, perform the search on dictionary and return the results. Decide a suitable approach for creation and organisation of data stored in the Dictionary so that search process is efficient. Store Dictionary content in a file. Program should search for dictionary by performing a direct access to a record. This can be achieved by indexing data and maintaining a separate index file. 3) Client Application: Write a sample client application that invokes "DictionarySearch" function/method and demonstrates services provided by the server. If you client application name is "MyClient", then accept port_number and "word to be searched" as command line arguments, so that it can be invoked as follows: "MyClient Server_Host_Name 4500 Word_Whose_Meaning_we_want_to_Know" e.g: "MyClient mundroo.cs.mu.oz.au King" If you like you can implement a client with GUI (graphical user interface). Error Handling ************** Handle approriate errors such as (a) trying to connect to a dictionary server, which does not exist, (b) host does not exist, (c) wrong input data, etc.. in both clients and a server. Language: ********* The exercise can be implemented in either Java (preferably) or C but the programs should not use RMI(Java) or RPC(C). Please stick to basic networking and multi-threading libraries in either case. Testing and Evaluation: *********************** You need write your own client application that demonstrates all functionalities. Submission and Demo: ******************** You will basically need to demonstrate its working and submit a short report. You need to write a short report (highlighting the system architecture and client-server protocol along with appropriate diagrams). Also include a source code of your program (both client and server). STEP 1: Submission 1. Submit a report + code by email to TA STEP 2: Demo to TA (Teaching Assistant) 1. Please bring a printed version of report with *** your name and student number *** written on TOP of the 1st page of your Report for demonstration and handover the same to TA during demonstration. 2. Please make sure your program is on one of the Dept. server so that you can login and demonstrate. Or if you have a laptop, you can demonstrate on it. 3.You need to demonstrate working of your implementation to TA on Demo Day anytime between 12noon-2pm in his office. ---------------------------------------------------------------------------