Java Network Programming Learning notes (i)

Source: Internet
Author: User

1. Communication between processes

A process is a running program, and the task of a process is to execute the code in the program.

There are two processes on a computer network that only need to focus on the specifics of their communication, without needing to focus on the specifics of the message being transmitted over the network.

2. The concept of computer networks

Services provided by the Internet include the WWW service, e-mail service, File Transfer Service (FTP), Remote Login service (telnet). Users around the world can access information on the Internet or conduct a variety of businesses through or through these services.

3.UDP and TCP

Two processes can occupy the same port number, but must be different transport layer protocol, such as a process using TCP protocol, occupy 7000 port, then there can be a process using the UDP protocol, It also occupies 7000. The port is not a physical port of real existence, but is logically present to differentiate the processes.

4.socket sockets

The transport layer provides socket sockets to the application layer, the socket encapsulates the underlying data transfer details, and the application layer's program uses the socket to establish a connection to the remote host and to transmit data.

At the application layer's point of view, a communication process between two processes starts with establishing a connection, then exchanging data to end the disconnection. Sockets can be thought of as transceivers at both ends of a communication link, and the process is sending and receiving data through sockets.

There are three types of sockets in Java: Java.net.Socket, Java.net.ServerSocket and Java.net.DatagramSocket. Where sockets and ServerSocket are based on the TCP protocol, Datagramsocket is based on UDP.

The Java Network program uses the client/server communication mode, and the Java Network program is committed to implementing the application layer.

Java Network Programming Learning notes (i)

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.