C + + Game Server Programming Learning notes (i)

Source: Internet
Author: User
Tags prev

C + + game Server programming
C + + operating efficiency is very high
TCP Transmission Control Protocol
IP Internetwork Protocol
Linux Ubuntu
Open source third-party libraries
80% game Server side with C + +
The hardest part of the work is the specific game logic.
Common game server frameworks and key parts of the implementation
IP Internetwork Protocol
The communication interaction model of OSI Model open system academic product
Application layer, presentation layer, session layer, Transport layer, network layer, link layer, physical layer

IP model
Produced in practice to be used as a standard

Encapsulation of data into the protocol stack
Ethernet Package minimum 46 bytes, less than 0
Maximum of 1500 bytes

IP protocol features: unreliable, no connection
There is no guarantee that the IP datagram will arrive at the destination successfully
Provide the best transfer service

The network data is transmitted according to the big endian.
IP Datagram Format header field
Home operating System Little endian

Most of the server side of the game with the TCP protocol
TCP Detailed
How TCP takes advantage of IP
TCP splits the application's transfer data into appropriate chunks
Delay Confirmation
Inspection and
Flow control
TCP encapsulates the data to be sent by the application
Tcp,ip There is no option, the header is 20 bytes.

TCP Header

The state transition of TCP
TCP connection Acknowledgement (three-time handshake)
Unidirectional link list reversal (study pointer)
struct Node
Node* Next;
int value;


Static node* reverselist (node* N) {
node* prev= nullptr;
while (n) {
node* next=n->next;
return n;

C + + Game Server Programming Learning notes (i)

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.