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

  1.  
  2.  SOCKET consists of three client/server samples and SELECTS.C
  3.  (located in \TOOLKIT\SAMPLES\TCPIPTK\SOCKET).
  4.  
  5.  SELECTS.C is a simple TCP and UDP server that uses the BSD
  6.  select() call. MSGC.C/MSGS.C, TCPC.C/TCPS.C and UDPC.C/UDPS.C
  7.  are sample C socket client/server programs demonstrating
  8.  network programming with OS/2 sockets.
  9.  
  10.  Following are details on building and executing the RPC Samples:
  11.  
  12.     1. To compile and link the sample programs, type:
  13.  
  14.          nmake -f vacpp.mak         (to build using the VisualAge C/C++ compiler)
  15.  
  16.     2. Executing udps.exe and udpc.exe
  17.  
  18.          a. To start udps server, type:
  19.  
  20.             start udps
  21.  
  22.             An additional session is created and the following
  23.             message is displayed:
  24.  
  25.             Port assigned is 1028
  26.  
  27.  
  28.          b. To run udpc client, type:
  29.  
  30.             udpc 9.67.60.10 1028
  31.  
  32.             Where:
  33.  
  34.             9.67.60.10       IP address of machine where udps
  35.                              server is running.
  36.  
  37.             1028             Port assigned by udps server.
  38.  
  39.             After executing the udpc client, you will see the
  40.             following output on the server session:
  41.  
  42.                      Received message Hello ................
  43.  
  44.  
  45.     3. Executing tcps.exe and tcpc.exe
  46.  
  47.          a. To start tcps server, type
  48.  
  49.             start tcps 2000
  50.  
  51.             where:
  52.  
  53.             2000             Port number assigned to tcps server
  54.  
  55.          b. To run tcpc client, type
  56.  
  57.             tcpc charm 2000
  58.  
  59.             where:
  60.  
  61.             charm            hostname of machine where tcps server
  62.                              is running.
  63.  
  64.             2000              Port assigned to tcps server.
  65.  
  66.     4. Executing selects.exe
  67.  
  68.        The SELECTS server has the same function as the TCPS and
  69.        UDPS servers.
  70.  
  71.          a. To start the SELECTS server, type:
  72.  
  73.             start selects 2000
  74.  
  75.             where:
  76.  
  77.             2000             Port number assigned to selects server
  78.  
  79.          b. To run tcpc client, type
  80.  
  81.             tcpc charm 2000
  82.  
  83.             where:
  84.  
  85.             charm            hostname of machine where selects
  86.                              server is running.
  87.  
  88.             2000             Port assigned to selects server.
  89.  
  90.          c. To run udpc client, type
  91.  
  92.             udpc 9.67.60.10 2000
  93.  
  94.             where:
  95.  
  96.             9.67.60.10       IP address of machine where selects
  97.                              server is running.
  98.  
  99.             2000             Port assigned by selects server.
  100.  
  101.        After executing the udpc client, you will see the following
  102.        output on the server session:
  103.  
  104.        Received message Hello ................
  105.  
  106.  
  107.     5. Executing msgs.exe and msgc.exe
  108.  
  109.        msgs.c and msgc.c are the same program as udps.c and
  110.        udpc.c except they are written using recvmsg() and
  111.        sendmsg() calls.
  112.  
  113.          a. To start the msgs server, type:
  114.  
  115.             start msgs
  116.  
  117.             An additional session will be created and the following
  118.             message will appear.
  119.  
  120.             Port assigned is 1028
  121.  
  122.  
  123.          b. To run msgc client, type
  124.  
  125.             msgc 9.67.60.10 1028
  126.  
  127.             where:
  128.  
  129.             9.67.60.10       IP address of machine where msgs
  130.                              server is running.
  131.  
  132.             1028             Port assigned by msgs server.
  133.  
  134.  
  135.