COMP2396B作业代写、Java程序语言作业调试、Java课程作业代做、server program作业代写代写Database|代写Web开发

COMP2396B - AssignmentDue: 3rd May, 2019 23:55IntroductionThis assignment tests your skills on writing networking and multi-threading program in Java.You are required to write a peer-to-peer (P2P) images sharing system. A hybrid P2P structureis used in this assignment, where a server is used as the source of images as well as that of thelist of peers available. In this assignment, you have to integrate the program written inAssignment 3 and Assignment 4 to complete this assignment.You need to write two main programs. ImageServer.java is the server program, andImagePeer.java is the client (peer) program. Notice that a server will also act as a peer toshare images.Part I. Server interfaceWhen ImageServer.class is executed, a file chooser should be presented to ask for animage file. (Figure 1)Figure 1: File chooser Figure 2: Server GUIThe image is then loaded and displayed as shown in Figure 2. If the image file fails to load,the program terminates. Otherwise, the server should listen to the port 9000, and load the“User.txt” which contains the user information into the program and waiting for user to login.The “User.txt” is the file that generated by the assignment 3 authentication interface andshould include the following accounts for login:Username: mqpeng Password: Comp2396BUsername: cjli Password: 2396BCompUsername: cbchan Password:HelloWorld0The image should be resized and scaled to fit into a canvas of 700*700 pixels in size. Thebutton “Load another image” allows the user to change the current image. If the new imagefails to load, the old image is retained.Part II. Peer program and authenticationWhen ImagePeer.javais executed, it should ask for the server’s IP address to be connectedto. It then asks the peer user to login. (Figures 3, 4 and 5). For the user authentication, you arerequired to use the authentication module implemented in Assignment 3 as the interface.The client should use the hash interface to hash the password before sending to the server andthe server need to verify the user information before starts the main GUI. Hence, the servershould also return the message if the user cannot login. (e.g. Account is locked)Figure 3: Username inputFigure 4: Username input Figure 5: Password inputIf the login is failed or locked, it should show an alert. (Figure 6)Figure 6: Login alertFigure 7: Peer GUIFigure 7 Peer GUIIf the login is successful, an empty canvas should then be presented as shown in Figure 7. Likethe server, the canvas size in the peer should also be 700*700 pixels.Immediately after the GUI is shown, the peer should connect to the server and start to downloadthe image from the server and other peers. Program should be terminated if it fails to connect tothe server. (See details below)Part III: Peer initializationThe server should listen to port 9000 after initialization. The server has to maintain thefollowing:1. The image, separated into blocks of 70*70 pixels in size2. A list of active peers (the peer IP address and port number)When a peer program is started, it should connect to the server at port 9000. The servershould then update the list of active peers, and each peer should collect the list of currentactive peers from the server. This connection can be closed afterwards.Part IV: P2P operationEach peer should perform the following:1. Try to download blocks of image from the list of peers in simultaneously.2. Accept connection from other peers and send out blocks of images otherpeersneeded.Notice that the server itself is a special peer that is the source of the image to be distributed.Details about the suggested P2P operation will be introduced in the tutorial.Part V: Update imageThe image should be updated if:1. If the user switches the image from the server program, all peers will change its imageimmediately.2. The user drags and drops the image block using the server program GUI. For such case, theclient only required to download the swapped image blocks.Example executionExecution result depends on how the P2P operation is implemented. Here is an exampleof the execution behavior.When the first peer starts (after the server), it startsdownloading blocks of image from the only peer(the server) available.When the second peer starts, it starts downloadingfrom the server peer (the bottom part) and thefirst peer (the middle part).Notice that since the first peer is also downloadingthe blocks, the server is sending out blocks to thetwo peers in an alternating manner so that the firstpeer can download the other blocks from the secondpeer.The first peer will also start download from thesecond peer.Marking- 85% marks are given to the functionality. You may add additional classes, instant variables and methods to the project. You may need to include and modify the classes implemented in assignment 3 for theauthentication function.You will get part of the marks if you implemented some of the features. A program that can run normally without throwing exceptions during runtime getshigher marks. Program with compile error will get 0 mark.- 15% marks are given to your JavaDoc. A complete JavaDoc includes documentationof every classes, member fields and methods that are not private. JavaDoc for the mainmethod may be omitted.SubmissionPlease submit all source files (all *.java file and login information file) in a single compressedfile (in .zipor .7z) to Moodle. Please also include your generated ‘User.txt’ file. Late submission isnot allowed. Program with compile error will get 0 mark. (Please include any code that helpcompile)Program with no Javadoc will not be graded.Do not submit .class file.PlagiarismDo not attempt plagiarism. We will check your program with software that checks programstructure. Both the source and the copying work will be penalized.-- END --When the user switches the image in the server, thepeers which choose to update the image willdownload new blocks from the server and otherpeers.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(COMP2396B作业代写、Java程序语言作业调试、Java课程作业代做、server program作业代写代写Database|代写Web开发)