overlap
所属分类:网络编程
开发工具:Visual C++
文件大小:1140KB
下载次数:5
上传日期:2012-09-17 15:32:31
上 传 者:
volye
说明: Sock重叠IO模型源代码,很好的学习Sock重叠IO的例子。
(Sample demonstrating use of Events in Overlapped (Asynchronous) I/O.)
文件列表:
Overlap.ncb (6016000, 2012-07-15)
Overlap.sln (878, 2010-04-19)
overlap.vcproj (3905, 2010-04-19)
overlap.vcproj.W520.Administrator.user (1411, 2012-07-15)
Makefile (1039, 2010-04-19)
Overlap.c (22201, 2010-04-19)
overlap.c:
---------
This TCP sample demonstrates the use of AcceptEx() and overlapped I/O to
multiplex different client connections in a single-threaded Win32 application.
AcceptEx is a Microsoft-specific extension to Windows Sockets. It is not
part of the Windows Sockets specification. If you use this function, you
will limit your application to only run over implementations of Windows
Sockets that support AcceptEx -- some implementations do not.
The server uses AcceptEx() to handle a number of asynchronous connection
requests effectively. When a connection is received, it is added to an array o
handles being monitored in a wait function.
The server multiplexes between the listening socket and the various client
connections.
When a connection is first established, the server queues an overlapped
WSARecv() operation on the socket. On subsequent notification that this
operation has completed, the server queues a WSASend(). Thus, the server does
alternate recvs and sends on the socket, until the client closes the
connection.
The simplec.exe client under the 'simple' directory can be run against this
overlapped server.
usage:
overlap -e -i
where,
endpoint is the port to listen on.
interface is the IP address to bind to for multi-homed hosts.
近期下载者:
相关文件:
收藏者: