Author: Zhu Jincan
Source: blog.csdn.net/clever101
How does one understand windows socket?
My understanding: Windows Socket is equivalent to a communication channel opened by two network entities on the Windows platform. The implementation details of this communication channel are invisible to both sides of the network (haha, you will know that it is made in Windows ). Through this channel, both parties can transmit various types of data.
You may be anxious to ask how this channel was opened? Next I will describe the server segment and client as both sides of the network. See:
Do you understand this? The connection between the server and the client is actually the connection between the server socket and the client socket. What is the specific procedure? In fact, it is very simple to create a socket class object in the server program, create a socket class object in the client program, and then hand over the network communication work such as connection and data transmission to them.
After understanding the socket communication model, Do you think Windows Socket network programming is not as difficult as you think? Then you can learn about the usage of the socket class casyncsocket and csocket class in MFC. We recommend that you take a look at the article Windows Sockets:
Socket communications and the following
MSO; MSO-font-kerning: 0pt "> • Windows
Sockets: using class casyncsocket
MSO; MSO-font-kerning: 0pt "> • Windows
Sockets: deriving from socket classes
MSO; MSO-font-kerning: 0pt "> • Windows
Sockets: How sockets with archives work
MSO; MSO-font-kerning: 0pt "> • Windows
Sockets: Blocking
MSO; MSO-font-kerning: 0pt "> • Windows
Sockets: byte Ordering
MSO; MSO-font-kerning: 0pt "> • Windows
Sockets: Converting strings
MSO-bidi-font-family:; MSO-font-kerning: 0pt "> MSO-bidi-font-family:; MSO-font-kerning: 0pt "> In fact, the socket class in MFC is similar to the cwnd class, that is, there are some message excitation functions. You need to understand the conditions under which these functions will respond. Finally, I suggest you understand the routine of Windows Sockets: Socket comprehensions (click the samplemso-Hansi-font-family: "Times New Roman" '> link ), it is a simple chat program, which is very helpful for understanding socketmso-Hansi-font-family: "Times New Roman" '> (I just got it from that ).