Message-Oriented TCP and Multithreaded Client/Server (192570)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC)
This article was previously published under Q192570 SUMMARY MFCAsync.exe contains a Visual C++ 5.0 project sample that
shows the communication techniques between a client (AsyncClient) and a server
(AsyncServer) application using MFC CAsyncSocket class on each sides.
Here are some highlights of this sample: - MFCAsync.exe follows KB article
175668, showing the use of Transmission Control
Protocol (TCP) socket communication in a separate thread other than the
Graphics User Interface (GUI) thread; as such, the blocking of the GUI message
pump does not affect the delivery of socket messages. Multiple instances of
AsyncClient can talk to the same instance of AsyncServer.
- MFCAsync.exe also complies with KB Article
185728 in issuing of socket Send and Receive calls.
- MFCAsync.exe adds message boundary on top of the
stream-oriented TCP. Each message is sent with a 4-byte-length packet header
followed by the body of the message. Users can append more customized packet
header fields to this length field.
REFERENCES For more information, please see the following articles in
the Microsoft Knowledge Base: 175668
FILE: MultiSoc: Illustrates Using Sockets in Multiple Threads
For more information about downloading files from the Microsoft
Software Library, please see the following article in the Microsoft Knowledge
Base: 185728
SAMPLE: MFCSocs.exe Avoids Two Common MFC Socket Mistakes
Modification Type: | Minor | Last Reviewed: | 8/9/2004 |
---|
Keywords: | kbdownload kbAPI kbfile kbinfo kbnetwork kbWinsock KB192570 kbAudDeveloper |
---|
|