comp90015 课业解析题意:使用客户端-服务器体系结构,设计并实现允许并发的多线程服务器客户端搜索单词的含义,添加新单词,并删除现有单词。解析:使用socket构建一个可以连接多个客户端的多线程服务器,服务器从包含初始列表的文件中加载字典数据单词及其含义,数据在一个能够实现的结构中把存在内存中的高效单词搜索。添加或删除单词,数据结构将更新并反映变化。客户端它会创建绑定到服务器地址和端口的套接字数。此套接字在客户端-服务器交互期间保持打开状态。所有消息通过此套接字发送/接收涉及技术点:socket,java Tcp/Udp套接字编程,GUI界面实现实现代码:进行中。
COMP90015: Distributed Systems – Assignment 1Multi-threaded Dictionary Server (15 marks)Problem DescriptionUsing a client-server architecture, design and implement a multi-threaded server that allows concurrentclients to search the meaning(s) of a word, add a new word, and remove an existing word.This assignment has been designed to demonstrate the use of two fundamental technologies that havebeen discussed during the lectures: Sockets ThreadsHence, the assignment must make an EXPLICIT use of the two above. By explicit, we mean that in yourapplication, sockets and threads must be the lowest level of abstraction for network communication andconcurrency.Architecture The system will follow a client-server architecture in which multiple clients can connect to a(single) multi-threaded server and perform operations concurrently. The multi-threaded server may implement a thread-per-request, thread-per-connection, orworker pool architecture. This is a design decision for you to make.Interaction All communication will take place via sockets. These sockets can be either TCP or UDP, however,keep in mind that all communication between clients and server is required to be reliable. You are responsible for designing your own message exchange protocol. Some data formats thatyou may use include XML, JSON, Java Object Serialization, or you may choose to design your own.Failure Model All communication between components has to be reliable. If you are using TCP, then thereliability guarantees offered by the protocol are sufficient. If you decide to use UDP, then youhave to implement an infrastructure that offers reliable communication over UDP. For those ofyou with previous experience using TCP, using UDP may be a rewarding challenge. It is expected that, on both the server and the client side, errors (by means of exception handling)are properly managed. The errors include the following: Input from the console for what concerns the parameters passed as command line. Network communication (address not reachable, bad data…). I/O to and from disk (cannot find the dictionary file, error reading the file, etc…). Other errors you might come up with.The application will be tested and validated against all these errors.Functional Requirements Query the meaning(s) of a given wordThe client should implement a function that is used to query the dictionary with the followingminimum (additional input/output parameters can be used as required) input and output:Input: Word to searchOutput: Meaning(s) of the wordError: The client should clearly indicate if the word was not found or if an error occurred. In caseof an error, a suitable description of the error should be given to the user. Add a new wordAdd a new word and one or more of its meanings to the dictionary. For the word to be addedsuccessfully it should not exist already in the dictionary. Also, attempting to add a word withoutan associated meaning should result in an error. A new word added by one client should be visibleto all other clients of the dictionary server. The minimum input and output parameters are asfollows:Input: Word to add, meaning(s)Output: Status of the operation (e.g., success, duplicate)Error: The user should be informed if any errors occurred while performing the operation. Remove an existing wordRemove a word and all of its associated meanings from the dictionary. A word deleted by oneclient should not be visible to any of the clients of the dictionary server. If the word does not existin the dictionary then no action should be taken. The minimum input and output parameters areas follows:Input: Word to removeOutput: Status of the operation (e.g., success, not found)Error: The user should be informed if any errors occurred while performing the operation.User InterfaceA Graphical User Interface (GUI) is required for this project. You are free to design it and to use anyexisting tools and libraries for this purpose.Implementation GuidelinesThese are guidelines only, you are allowed and encouraged to come up with your own design andinterfaces. When the server is launched, it loads the dictionary data from a file containing the initial list ofwords and their meanings. These data is maintained in memory in a structure that enables anefficient word search. When words are added or removed, the data structure is updated toreflect the changes.A sample command to start the server is:> java –jar DictionaryServer.jar
userrequests within a server in scalable, reliable, and efficient manner) will be considered a plus. Forexample, using your own implementation of a thread pool (not Java’s) would earn you thesemarks. You need to explicitly write in the Report all Creativity elements (point-by-point listingwith brief illustration/discussion included) in a separate section.NOTE 1 (EXTREMELY IMPORTANT): The excellence and the creativity marks (5 marks) cannotcompensate any lack in the first part (the one that scores up to 10 marks). Please concentrateyour efforts in getting the first 10 marks done and then proceed with the rest.Note 2: Don’t document anything you haven’t implemented in the report. This is misconduct and willresult in severe penalties.Demonstration Schedule and VenueYou are required to provide a demonstration of the working application and will have the opportunity todiscuss with the tutors the design and implementation choices made during the demo.You are free to develop your system where you are more comfortable (at home, on one pc, on your laptop,in the labs…) but keep in mind that the assignment is meant to be a distributed system that works on atleast two different machines in order to separate the client from the server.We will announce the demo date, time, and venue closer to the due date. Each tutor will hold 2-3 demosessions and you will be required to showcase your system in one of the sessions held by the tutor of theworkshop in which you are enrolled.If you need any clarification on the assignment, kindly ask questions during the tutorials or in the LMSforum, so that all students benefit from it.Note: You need to submit a printed copy of your report during the demonstration.Penalties for late submissions of assignmentsAssignments submitted late will be penalized in the following way: 1 day late: -1 mark 2 days late: -3 marks (-1 – 2) 3 days late: -6 marks (-3 – 3) 4 days late: -10 marks (-6 – 4) etc.