![]() |
Winsock Programmer's FAQ |
![]() |
About the GUI FrameworkThis example is based on the "MFCConsole" framework. Between that base and the FAQ-specific extensions, there are 1800 lines of generic framework code, neatly separated from the specific parts of each example based on it. You do not need to understand this framework to learn from the examples, but if you are interested, you can find information about the framework on the MFCConsole page. The example framework has two main menu items: "Start Winsock Handler"
(Ctrl-W), and a generic "Action" item (Ctrl-A). When you give the
Start command, it calls The Unique BitsAll the following comparisons are against the Winsock API-based asynchronous I/O client. That phrase is a mouthful, so we'll just call it the "pure asynch" client below. The unique parts of this example are in the CCASClientSocket class.
Aside from the CNetworkDriver interface, this class derives from
CAsyncSocket so we can override functions like The The rest of the program is pretty much identical to the pure async client, because CAsyncClient (like the rest of MFC) maps pretty closely to the underlying API. Nevertheless, the several small savings of the wrapper class did add up: this program is only 230 lines of code, a savings of 100 lines over the pure API version. To be fair, though, adding on your own asynchronous lookup function and timeout timers would eat into that 100 line savings. The CodeThe project package (33 KB) is a complete Visual C++ 5.0 project. It includes everything you need to build the sample. LicenseNote that this example program is released under a different license than the other example programs. It's a BSD-style license, which means you can do anything you want with the example so long as you don't sue me or my employer if it prints 500 pages of "Microsoft sux!" on your customer's high-speed laser printer. |
<< Asynchronous I/O Client | Basic Blocking Server >> |
Last modified on 19 October 2001 at 15:17 UTC-7 | Please send corrections to tangent@cyberport.com. |
< Go to the main FAQ page | << Go to the Home Page |