Assignment #3 Part ADue 5:00PM November 11 (Monday) 2019How to turn in Assignment #3 Part A: Save the Java source code for the server in a file named assign3Server.java . Log into Canvas. In the Canvas site for this course, click Assignments and then click the link assign3a and upload the file assign3Server.java . The file must be submitted by uploading the file in Canvas.Be sure to include your full name as a comment at the beginning of the source file.This assignment is essentially an exercise on wrinting a server that guesses a number in 1..1000 that a client chooses. The server must be able to serve multiple clients simultaneously.Overall, a client is to choose a number in the range 1..1000 without telling the server the chosen number. Then the server and the client will engage in a dialog through which the server will find the chosen number by making no more than ten educated guesses. You should write the server and then test the server with telnet, which connects to the server running on the local machine by the command telnet 127.0.0.1 4192 As an example of servicing a single client, click here to see the server window and click here to see the telnet window. In this example, the user chose the number 419 (but the server does not know that). In the telnet window, the text in red is text entered by the user, and the text in blue is text sent by the server to telnet (the client). The server is able to detect a cheating user. For example, if the user cheats by answering L when the server guesses 419, the telnet window will be this but the server window will代写Canvas site、java程序语言调试、java代 remain this. Note that in the server window, the text ***Starting a dialog with Joe was displayed only after the user enters the name Joe in the telnet window. It should be obvious that the algorithm that the server uses to guess the number is similar to binary search. If such an algorithm fails, it can be inferred that that user changes his mind at some point during the dialog (that is, the user cheats). The server also detects incorrect response (a response that is not C, not H and not L) from a client. As an example of an incorrect client response, click here to see the server window and here to see the client window.The server can handle multiple clients concurrently. As an example of the server servicing two telnet clients concurrently, click here to see the server window, and click here and here to see the telnet client windows. In the example, Joes chosen number is 419 and Toms is 221. As shown in the server window, Toms diaglog begins after Joes and ends before Joes. This implies that the two dialogs proceeded concurrently. On the other hand, if Toms dialog ends after Joes, the then server widnow will be this, which shows that the two dialogs only partially overlap in time.The user interface of your server to a client must be identical to that shown in the examples.Do not use any package statement in your Java code (i.e., your Java program will belong to the default package). Your source file must NOT depend on any IDE ( integrated development environment) to compile or to run. Your source file will be tested in the command-line environment. 转自:http://www.3daixie.com/contents/11/3444.html
讲解:Canvas site、java、java、multiple clientsR|Java
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- mybatis 中没有 if...else...的写法,mybaits 中没有else要用chose when o...