home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / tcpiptk / echosamp / echosrv / readme < prev    next >
Text File  |  1999-05-11  |  4KB  |  96 lines

  1. Echosamp consists of two subdirectories, an echo client (echoclnt)
  2. and an echo server (echosrv), located in \TOOLKIT\SAMPLES\TCPIPTK\ECHOSAMP.
  3.  
  4. The echosrv directory contains three samples of echo servers:
  5.  
  6. ECHOSMT.C  - This version of the server is a multithreaded, multiclient
  7.              TCP/UDP echo server.  It starts a new thread for each
  8.              TCP connection it accepts.  The main thread is responsible for
  9.              handling UDP echo requests, issuing the accept() for each new
  10.              TCP connection, and spinning off a thread to service it.
  11.  
  12. ECHOSRV.C  - This version of the server is a single threaded, multiclient
  13.              TCP/UDP echo server.  It services UDP echo requests, TCP echo
  14.              requests, and requests for new TCP connections all from one
  15.              thread using select().
  16.  
  17.  
  18. ECHOSTCP.C - is a single threaded, TCP only echo server.  It services only one
  19.              TCP echo client at a time.
  20.  
  21. This program implements the server side of the Echo protocol (RFC 862).  The
  22. Echo protocol is very simple: whatever the client sends to the server, the
  23. server will send right back to the client.
  24.  
  25. This version of the server services UDP echo requests, TCP echo requests, and
  26. requests for new TCP connections all from one thread using select().
  27.  
  28. The complete RFC is reproduced below:
  29.  
  30.  
  31. Network Working Group                                          J. Postel
  32. Request for Comments: 862                                            ISI
  33.                                                                 May 1983
  34.  
  35.                              Echo Protocol
  36.  
  37. This RFC specifies a standard for the ARPA Internet community.  Hosts on
  38. the ARPA Internet that choose to implement an Echo Protocol are expected
  39. to adopt and implement this standard.
  40.  
  41. A very useful debugging and measurement tool is an echo service.  An
  42. echo service simply sends back to the originating source any data it
  43. receives.
  44.  
  45. TCP Based Echo Service
  46.  
  47.    One echo service is defined as a connection based application on TCP.
  48.    A server listens for TCP connections on TCP port 7.  Once a
  49.    connection is established any data received is sent back.  This
  50.    continues until the calling user terminates the connection.
  51.  
  52. UDP Based Echo Service
  53.  
  54.    Another echo service is defined as a datagram based application on
  55.    UDP.  A server listens for UDP datagrams on UDP port 7.  When a
  56.    datagram is received, the data from it is sent back in an answering
  57.    datagram.
  58.  
  59.  
  60. Following are details on building and executing the echo server samples:
  61.  
  62.    1. To compile and link the sample programs, type:
  63.  
  64.         nmake -f vacpp.mak         (to build using the VisualAge C/C++ compiler)
  65.  
  66.     2. Executing echosmt.exe, echosrv.exe and echostcp.exe
  67.  
  68.          a. To start the echosmt server, type:
  69.  
  70.             start echosmt
  71.  
  72.             An additional session is created and the following
  73.             messages are displayed:
  74.  
  75.             TCP socket assigned is 144
  76.             UDP socket assigned is 145
  77.  
  78.          b. To start the echosrv server, type:
  79.  
  80.             start echosrv
  81.  
  82.             An additional session is created and the following
  83.             messages are displayed:
  84.  
  85.             TCP socket assigned is 146
  86.             UDP socket assigned is 147
  87.  
  88.          c. To start the echostcp server, type:
  89.  
  90.             start echostcp
  91.  
  92.             An additional session is created and the following
  93.             message is displayed:
  94.  
  95.             TCP socket assigned is 148
  96.