Java Programming things 110--Network Programming summary

Source: Internet
Author: User
Tags character set

13.4 Chinese Questions

Network transmission process of the Chinese problem is also more prominent, the reasons for this problem and the previous IO part of the agreement, are due to the transmission process in the client program and server-side program used by the inconsistent character set, in the solution to the problem before the first of the following considerations:

Are you sure you want to transfer Chinese characters in your network?

As can be seen from the previous example, through the design of a certain protocol format, you can avoid the transmission of Chinese characters in the network, so that from the basis of the problem to avoid the emergence of China. For example, in the program needs to transmit the "success", "failure" such as the Chinese string, in the agreement can be agreed that the number 0 represents "Success", 1 represents "failure", so that the transmission of numbers on the network, on the client and server side of a simple transformation can be.

In fact, this is the design of the network protocol, the basic design skills, through the use of this technique can reduce the amount of data transmission network, but also to fundamentally avoid the network transmission process of Chinese problems.

If you must transmit Chinese characters in the network, such as the chat information in QQ, this requires that the character set code used by the client program and the character set code used by the server-side program be consistent, which is the most basic way to solve the problem.

13.5 Summary

On the Java language Network programming, this chapter introduces the basic knowledge of network programming, introduces the Java language in the TCP and UDP format of the network programming, and through a simple example to demonstrate the basic use of network programming, through the introduction of these content to bring everyone into the door of network programming, Of course, the need to fully master network programming, but also need to do a lot of hard and excellent work, if the reading of this chapter is easier, but also to the network programming advanced words, suggest reading the Java 2 network protocol inside the book.

13.6 Network Practice

1, respectively, the use of TCP and UDP mode, the implementation of the client input Arabic numerals into Chinese capital numbers.

2, the use of TCP and UDP, respectively, the implementation of this chapter of the calculator example, the client and server-side functional division and framework implementation.

3. Design a simple program to upload files to the server and realize the storage of files on the server side.

4, read Peer-to-peer network of relevant knowledge, to achieve a Peer-to-peer chat program.

Related Article

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.