Mfcsocs.exe sample demonstrates how to communicate in a TCP connection in Visual C++ (185728)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q185728 NOTE: Microsoft Visual C++ .NET (2002) and Microsoft Visual C++ .NET
(2003) support both the managed code model that is provided by the .NET
Framework and the unmanaged native Windows code model. The information in this
article applies to unmanaged Visual C++ code only. SUMMARY The MFCSocs sample is a minimal MFC application that
demonstrates how to use the CSocket and CAsyncSocket classes to communicate in
a Transmission Control Protocol (TCP) connection. This sample is a dialog-based
application. Depending on the selection in the user interface, the application
can run either as a TCP server that listens on a certain TCP port, or as a
client that connects to a server on the same TCP port.
When running
as a client, the application uses the CSocket class to communicate with the
server. When running as a server, the application uses CAsyncSocket to listen
to connection requests and communicate with the client after the connection is
established.
Modification Type: | Major | Last Reviewed: | 5/31/2005 |
---|
Keywords: | kbinfo kbAPI kbfile kbhowto kbnetwork kbSample kbWinsock KB185728 kbAudDeveloper |
---|
|