home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / winsock / overlap / readme.txt < prev   
Text File  |  1996-05-05  |  1KB  |  29 lines

  1. overlap.c:
  2. ---------
  3. This TCP sample demonstrates the use of AcceptEx() and overlapped I/O to 
  4. multiplex different client connections in a single-threaded Win32 application.
  5.  
  6. AcceptEx is a Microsoft-specific extension to Windows Sockets.  It is not
  7. part of the Windows Sockets specification.  If you use this function, you
  8. will limit your application to only run over implementations of Windows
  9. Sockets that support AcceptEx -- some implementations do not.
  10.  
  11. The server uses AcceptEx() to handle a number of asynchronous connection
  12. requests effectively. When a connection is received, it is added to an array o
  13. handles being monitored in a wait function. 
  14. The server multiplexes between the listening socket and the various client
  15. connections. 
  16.  
  17. When a connection is first established, the server queues an overlapped
  18. ReadFile operation on the socket. On subsequent notification that this
  19. operation has completed, the server queues a WriteFile. Thus, the server does
  20. alternate reads and writes  the socket, until the client closes the
  21. connection.
  22.  
  23. usage:
  24.     overlap -e <endpoint>  -i <interface>
  25.  
  26.     where,
  27.     endpoint is the port to listen on.
  28.     interface is the IP address to bind to for multi-homed hosts.
  29.