⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winsockapi_wrappers.shtml

📁 mfc资源大全包含MFC编程各个方面的源码
💻 SHTML
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Zafir Anjum">
   <TITLE>Internet - Winsock API Wrapper Classes</TITLE>
</HEAD>
<body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000">
<table WIDTH="100%">
<tr WIDTH="100%">
<td align=center><!--#exec cgi="/cgi/ads.cgi"--><td>
</tr>
</table>


<CENTER><H3><FONT COLOR="#AOAO99">Winsock API Wrapper Classes</FONT></H3></CENTER>
<HR>


<p>This sample was contributed by <a href="mailto:poul@wizsoft.com">Poul A Costinski</a></p>

<P>Creating multithreaded TCP/IP server - one like WWW server -:)
for NT becomes frequent task novadays. MFC supplies several socket
classes, but, from my experience, they are just unusable for this purpose.
They fail all the time, and several 1000s (!) times slower than raw Winsock
interface.

<P>Facing the challenge, I wrote my own thin wrapper classes around socket API,
together with template for server, and it was surprisingly simple.

<P>The complete example project is in file RawSocketServerExample.ZIP.

<P>Several notes for class usage:

<P>Server's thread dispatcher for client-server environment.

<H4>Class CWizThreadDispatcher.</H4>

Uses pure virtual helper class CWizMultiThreadedWorker.
Serves regular situation when requests come from many clients to the
server.
<P>Dispatcher starts to serve the client in the separate thread and continues to
wait for requests. The number of parallel threads is limited for
effectiveness. The actual work (whatever it is)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -