201621123034 Java Programming 13th Week of study summary

Source: Internet
Author: User

Job 13-Network 1. Summary of this week's study

Summarize multiple web-related content in the way you like (mind Mapping, OneNote, or others).

2. Add network functions to your system (shopping cart, library management, landlords, etc.)-group complete

To allow your system to be used by multiple users over the network, you need to add network functionality to your system.

2.1 What network functions do you want to add to your system? What is the design idea?

For:
The Library management system is set to the server side, set its port number is 8000, and then through the network connection to its menu content, etc. are returned to the connected client.
Design idea: Need to create a new NET class, implement multi-threading in net class, implement Runnable interface, implement menu operation in Run method. This allows the main function to constantly create threads and interfaces with multiple new clients.

2.2 What information does the system pass through the network? What is the format of the information?

A: The server passes the user information to the client over the network, and the customer passes the login and operation information to the server. The information uses byte-stream inputstream and OutputStream storage, which is transmitted through scanner and PrintWriter.

2.3 Does your network module use TCP or UDP technology? What are the common classes in a module?

Answer: TCP. Common classes are the Seversocket class and the socket class.

2.4 Network communication part of the source code and run, and to do a simple explanation.

Note: If you do not write a client, you can use telnet or * * Network debugging Assistant * To do the client.
For:
Source:



Operation Result:


2.5 Choose: Use the Client access system you wrote. Describe the core code inside.

A: See Code 2.4. The core code is to write a client, the client can connect on the server side (Library management system) IP and port number, read and output content, create multiple clients can be multi-threaded.

2.6 Choose to do: Is there a multi-threaded conflict or synchronization problem in the system? 3. Code cloud and PTA3.1 Statistics The amount of this week's work done

The weekly code statistics need to be fused into a single table.

Week Time Total code Amount New Code Volume total number of files number of new files
2 141 141 6 6
3 445 380 10 3
5 871 426 16 6
6 1496 623 26 10
7 2570 1076 40 14
8 2674 104 46 6
9 2997 323 53 7
10 3313 316 58 5
11 3724 411 68 10
12 4249 525 78 10
13 4540 291 87 9
14 5161 621 91 4
Option: 4. Network Learning Guide (the following job content is selected) 1. Network Fundamentals 1.1 Comparison ping www.baidu.comAnd ping cec.jmu.edu.cn, what is the difference between the analysis and return results? Why is there such a difference?

For:

The various values returned are different because their URLs are different, and the paths passed when they are accessed are different.

    • Reference: Experimental Task Book-topic 1
2. Write a TCP client program 2.1 reference Sockettest.java write a simple connection to the remote server applet Client.java, you can receive and display the information sent by the server. The remote host IP and port number must first be specified on the console at startup. (, show your own school number).

For:

2.2 Change the URL of the program to Bbs.newsmth.net, the port number to 23, and observe the return result again? Try to perform Telnet bbs.newsmth.net 23, comparing the returned results.

For:

2.3 Change the URL of the program to cec.jmu.edu.cn, and change the port number to 80 to see the results returned. No return results, why? How do I change the code to display properly? choose to do: Why does it return garbled characters? How to solve?

For:

2.4 Start the Network debugging assistant, set it to TCP Server, and start as shown (do not appear in the job)

Use Client.java this server to send information to the client by attempting to connect to the TCP server. (Key code and run result)
For:

3. ServerSocket with TCP server 3.1 simple single thread menuserver, title 3.1-3.4. (Key code and run, including the school number) can use the Network debugging assistant, set it to TCP Client (IP and port fill your menuserver IP and port), connect your menuserver. One of the 文件搜索功能To choose to do.

For:

3.2 Multi-threaded menuserver (intercept key code to prove that you are a multithreaded server, use multiple Telnet connection tests).

For:

    • You can control the startup stop of the server, view the basic information of the client link (IP, port, link time)
    • Expand: Disconnect a client from the server and view the client-side log records sent to the server
    • Reference: Experimental Task book-topic 3
    • Reference: EchoServer.java , ThreadedEchoServer.java (multi-threaded server)

201621123034 Java Programming 13th Week of study summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.