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 / wsock / readme.txt < prev    next >
Encoding:
Text File  |  1996-07-22  |  2.2 KB  |  63 lines

  1. Demonstration of the Windows Sockets API
  2.  
  3.  
  4. SUMMARY
  5. =======
  6.  
  7. The WSOCK sample demonstrates the basics of sockets programming, 
  8. specifically for Windows Sockets. It demonstrates how to accept incoming 
  9. connections (using the Windows Sockets Asynchronous Extension APIs, threads, 
  10. and traditional BSD-style blocking calls) and how to connect to remote 
  11. hosts. Once connected, you can send a text string to the remote host. WSOCK 
  12. also allows the user to view information on a user-entered host name.
  13.  
  14. WSOCK demonstrates how to use AcceptEx which is a Microsoft specific
  15. extension to Windows Sockets and which is only supported on Windows NT.
  16.  
  17.  
  18. MORE INFORMATION
  19. ================
  20.  
  21. For the sample to operate correctly, the TCP/IP protocol must be properly 
  22. installed. Also, if two machines are used over a network, both machines must 
  23. have a HOSTS text file (for Windows NT machines, this file is located in 
  24. %SYSTEMROOT%\SYSTEM32\DRIVERS\ETC\HOSTS; for Windows for Workgroups 
  25. machines, this file is located in C:/WINDOWS/HOSTS). Within each HOSTS file, 
  26. both the remote and local addresses of both machines must be listed.
  27.  
  28. WSOCK can run on a single machine (execute two copies of WSOCK) or over a 
  29. network with two machines. The following example explains how two separate 
  30. machines over a network would test WSOCK:
  31.  
  32.  1. Machine "Bob" executes a copy of WSOCK.
  33.  2. Machine "Fred" executes a copy of WSOCK.
  34.  3. Machine "Bob" chooses one of the Listen menu options (under WinSock) 
  35.     [Listen (Blocking), Listen With Threads, or Async Listen].
  36.  4. Machine "Fred" selects the Connect menu option (under WinSock).
  37.  5. Machine "Bob" enters "12" as a TCP port number.
  38.  6. Machine "Bob" waits for a connection.
  39.  7. Machine "Fred" enters "Bob" as the host name to connect to.
  40.  8. Machine "Fred" enters "12" as a TCP port number.
  41.  
  42. Both machines are now connected and can send strings back and forth by using 
  43. the WinSock Send Message menu option.
  44.  
  45. If Bob exits WSOCK while there is a connection, Fred receives a message box 
  46. notification.
  47.  
  48. FUNCTIONS USED
  49. ==============
  50.  
  51. accept
  52. closesocket
  53. connect
  54. gethostbyname
  55. getservbyname
  56. htons
  57. listen
  58. send
  59. recv
  60. WSAAsyncSelect
  61. WSACleanup
  62. WSAStartup
  63.