Visual C ++ network programming-notes and visual Network Programming

Source: Internet
Author: User

Visual C ++ network programming-notes and visual Network Programming

Part 1: Basic knowledge (network)

1. OSI Layer-7 network model: OSI network model is a reference model for Open System Interconnection. It includes 1. Physical hardware layer, 2. data link layer, 3. network layer, 4. Data Transmission Layer, 5. Session Layer, 6. Presentation layer, 7. Application layer. At the sending end of the network communication, each communication layer of its communication data is added to a packet header by the protocol of this layer, while the receiver is the opposite, when the data passes through each layer, the corresponding packet header data is stripped by the layer protocol.

 

Definition of each network layer

Physical hardware layer: corresponding physical devices, such as network cards

Data link layer: compressing and compressing data

Network Layer: network transmission of transmitted data

Data transmission layer: network transmission of information

Session Layer: establish a physical network connection

Presentation Layer: represents transmitted data in a certain format

Application Layer: Application Interface

2. TCP/IP protocol

The TCP/IP network model has only four layers, including the data link layer, network layer, data transmission layer, and application layer.

Network Layer Definition

Data link layer: network hardware devices and drivers such as NICs

Network Layer: IP protocol and other interconnection protocols

Data transmission layer: Provides communication methods for applications, usually TCP/UDP

Application Layer: processes the actual application layer protocol.

3. C/S Programming Model

Listening process: the server waits for the client connection request to arrive (on a specific IP address and port );

Part 2: Basic knowledge (Network Programming)

1. Socket. The windows socket-related API function is called the winsock function.

Classification of sockets: streaming socket (SOCK_STREAM) and datagram socket (SOCK_DGRAM); among them, streaming socket is specially used for TCP communication applications, datagram socket is used for applications that use UDP protocol for communication.

2. Network byte sequence: stores the most important bytes in data.

3. socket-related classes integrated in MFC

CAsyncSocket class and CSocket class (derived from the former)


What is the name of the most attractive flower shop ??

Ling Cao Ling
 
Visual c ++ programming learning notes source code Liu chunhui Cd content, mainly Chapter 12th grateful

Ah ah
 

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.