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?
2.2 What information does the system pass through the network? What is the format of the information?
2.3 Does your network module use TCP or UDP technology? What are the common classes in a module?
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 the network debugging assistant * To do the client. **
3. Code Cloud and PTA
3.1 Count the amount of code completed this week
* * Selected: 4. Web Learning Guide (the following job content is optional)
1.1 Compare Ping www.baidu.com with ping cec.jmu.edu.cn, what is the difference between analysis and return results? Why is there such a difference?
- As can be seen,
www.baidu.com and cec.jmu.edu.cn the IP address is different, because the server belongs to a different region. On the other hand, www.baidu.com the round-trip time is significantly cec.jmu.edu.cn longer. , this is the University of Jimei's server is closer to us and Baidu's server is farther away from us.
1.2 Telnet bbs.newsmth.net, what port number does this command connect to the remote host?
1.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.
- The screen is dark and there is no return content.
GET /index HTTP/1.0The School home page source code is returned when the command is used.
1.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 (80 port), Qqmusic (443 port), Firefox (51632 Port), WPS Cloud file (49883 port) and other programs are connected on the computer. Where QQ occupies 80 ports, and interacts with it 58.250.214.146 . The TCP protocol is used.
1.5 What are some of the essential information required to write a network program?
-
protocol, IP address, port, and domain name.
2. Writing a TCP client program
2.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.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 returned results are as follows:
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?
- The result is not returned because we did not send a GET request. Correct the code and run as follows:
2.4 Start the Network debugging assistant, set it to TCP server, and start, and try to use Client.java to connect to the TCP server and use that server to send information to the client. (Key code and run result)
201621123006 Java Programming 13th Week of study summary