Java Network Programming notes

Source: Internet
Author: User

1: Network Programming (understanding)   (1) network programming: Using Java language to realize data transmission and resource sharing between computers   (2) network programming model   (3) Three elements of network programming   A:IP address    a: Dot decimal    B:IP address composition    C:IP address classification    d:dos command    e:InetAddress  B: Port     is the identity of the application. Range: 0-65535. 0-1024 of them are not recommended for use.   C: Protocol    UDP: Data packaging, limited, non-connected, high efficiency, unreliable    TCP: establishing data channels, unlimited, inefficient, reliable   (3) socket mechanism   A: Both ends of the communication should have the socket object   B: All communication is operated through the IO between sockets   (4) The UDP protocol sends and receives data (mastering its own code)   sending:    Create a UDP Sender socket object     Create data and package data     Send data     Release resources      receive:    Create a socket object on the UDP receiver     Create a packet to receive data     receive data     Resolve packet     release resource   (5) TCP protocol to send and receive data (Master your own code)   Send:    Create a TCP Client socket object     Get output stream, write data     release resources      receive:     Create a TCP server-side socket object     Listen for client connections     Get input stream, read data     release resources   (6) Case:  A:UDP    a: The most basic UDP protocol to send and receive data    B: Improve the sending data to keyboard input    C: aA simple chat applet with multithreading improvements   b:tcp   a: The most basic TCP protocol to send and receive data    B: Server feedback    c: Client keyboard input Server console output    D: Client keyboard Input server writes to text file    e: Client reads text file server console output    F: Client reads text file server writes to text file    g: Uploading images    H: Multithreading improvements uploading files

Java Network programming note

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.