Study Number: 201621123032 Java programming 13th Week of study summary

Source: Internet
Author: User
Tags thread class

1: Summary of this week's study

2: Add network functionality to your system (shopping cart, library management, landlords, etc.)-Group Completion 2.1: A brief description of what network functionality do you want to add to your system? What is the design idea?

Create a server listening 8080 port, through the Network Assistant client access, create a socket object, the client to select the function, the server through the client's choice to return the corresponding service. Using multithreading technology, multiple clients can be accessed concurrently.

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

I/O stream is passed, Getinputstream,.getoutputstream is used to get or input byte stream, and it is wrapped in scanner,printwriter for transmission.

2.3: Is your network module using TCP or UDP technology? What are the common classes in a module?

Use TCP technology.
The classes commonly used in modules are the ServerSocket class, the socket class, and the thread class.

2.4: The network communication part of the source code and run, and a simple description.


Initialize the library and create a server to listen on port 8080. A thread is started when a client accesses it.



The client sends the request, the server returns the appropriate method, initiates the thread task, and the Threads class's Run method.

To run the video:

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

3: Code Cloud and PTA3.1: Count the amount of code done this week

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

Week Time Total code Amount new increase in code volume Total Folder Add new Folder
1 114 114 11 11
2 520 50W 16 6
3 1089 569 22 6
5 1425 336 29 7
6 1819 394 31 2
7 2987 1168 54 23
8 5437 2450 79 25
9 5695 258 84 5
10 6680 985 102 18
11 6935 255 111 9
12 7401 466 123 12
13 8899 1498 141 18
14 9382 483 146 5

4: Network Learning Guide (the following job content is selected) 4.1: Network Foundation 1: Compare ping www.baidu.com with ping cec.jmu.edu.cn, how does the analysis return result differ? Why is there such a difference?


Different: Accessing ping cec.jmu.edu.cn is less time consuming than accessing ping www.baidu.com. Because Ping Www.baidu.comIP address is located in Guangdong province Guangzhou, Ping cec.jmu.edu.cn address is located in Xiamen City, Fujian Province, Ping Tong Local education network since the faster.

2:telnet Bbs.newsmth.net, what port number does this command connect to the remote host?

Port number 23rd

3:telnet cec.jmu.edu.cn 80, try to answer: what do you see from the screen? Is the content returned from the home page of cec.jmu.edu.cn? What will I return if I try to use the Get/index http/1.0 command? See the experimental Task Book topic 1.

No content to see

Try using the Get/index http/1.0 command:

4 Start the Connectionwatcher, and then start a number of Internet-enabled programs (such as QQ, Telnet, browser, etc.), to see what the computer on the Internet, what port is used? What ports does QQ use to interact with those remote IPs, where are these IPs distributed? What protocols are used for communication?

QQ uses 80 port, ip:183.232.103.219, Shenzhen city, Guangdong province
360 browser is using 80 port, ip:180.163.251.158, Shanghai, China

5: What are some essential information to write a network program?

IP and its port; protocol

4.2: Write TCP client program 1: Refer to Sockettest.java to 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).

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.


The content returned is roughly the same, but because of the coding problem with eclipse, there are garbled

4.3:serversocket with TCP server 2: Multithreaded menuserver (intercept key code to prove that you are a multithreaded server, use multiple Telnet connection tests).

Study Number: 201621123032 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.