home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / toolkit / tcpiptk / socket / readme < prev    next >
Text File  |  1996-11-19  |  4KB  |  138 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.          make -f borland.mak        (to build using the Borland C++ compiler)
  16.          wmake -f watcom.mak        (to build using the Watcom C/C++ compiler)
  17.          nmake -f metaware.mak      (to build using the Metaware High C/C++ compiler)         
  18.  
  19.     2. Executing udps.exe and udpc.exe 
  20.  
  21.          a. To start udps server, type: 
  22.  
  23.             start udps
  24.             
  25.             An additional session is created and the following 
  26.             message is displayed: 
  27.  
  28.             Port assigned is 1028
  29.             
  30.  
  31.          b. To run udpc client, type: 
  32.  
  33.             udpc 9.67.60.10 1028
  34.             
  35.             Where: 
  36.  
  37.             9.67.60.10       IP address of machine where udps 
  38.                              server is running. 
  39.  
  40.             1028             Port assigned by udps server. 
  41.  
  42.             After executing the udpc client, you will see the 
  43.             following output on the server session: 
  44.  
  45.                      Received message Hello ................
  46.             
  47.  
  48.     3. Executing tcps.exe and tcpc.exe 
  49.  
  50.          a. To start tcps server, type 
  51.  
  52.             start tcps 2000
  53.             
  54.             where: 
  55.  
  56.             2000             Port number assigned to tcps server 
  57.  
  58.          b. To run tcpc client, type 
  59.  
  60.             tcpc charm 2000
  61.             
  62.             where: 
  63.  
  64.             charm            hostname of machine where tcps server 
  65.                              is running. 
  66.  
  67.             2000              Port assigned to tcps server. 
  68.  
  69.     4. Executing selects.exe 
  70.  
  71.        The SELECTS server has the same function as the TCPS and 
  72.        UDPS servers. 
  73.  
  74.          a. To start the SELECTS server, type: 
  75.  
  76.             start selects 2000
  77.             
  78.             where: 
  79.  
  80.             2000             Port number assigned to selects server 
  81.  
  82.          b. To run tcpc client, type 
  83.  
  84.             tcpc charm 2000
  85.             
  86.             where: 
  87.  
  88.             charm            hostname of machine where selects 
  89.                              server is running. 
  90.  
  91.             2000             Port assigned to selects server. 
  92.  
  93.          c. To run udpc client, type 
  94.  
  95.             udpc 9.67.60.10 2000
  96.             
  97.             where: 
  98.  
  99.             9.67.60.10       IP address of machine where selects 
  100.                              server is running. 
  101.  
  102.             2000             Port assigned by selects server. 
  103.  
  104.        After executing the udpc client, you will see the following 
  105.        output on the server session: 
  106.  
  107.        Received message Hello ................
  108.        
  109.  
  110.     5. Executing msgs.exe and msgc.exe 
  111.  
  112.        msgs.c and msgc.c are the same program as udps.c and 
  113.        udpc.c except they are written using recvmsg() and 
  114.        sendmsg() calls. 
  115.  
  116.          a. To start the msgs server, type: 
  117.  
  118.             start msgs
  119.             
  120.             An additional session will be created and the following 
  121.             message will appear. 
  122.  
  123.             Port assigned is 1028
  124.             
  125.  
  126.          b. To run msgc client, type 
  127.  
  128.             msgc 9.67.60.10 1028
  129.             
  130.             where: 
  131.  
  132.             9.67.60.10       IP address of machine where msgs 
  133.                              server is running. 
  134.  
  135.             1028             Port assigned by msgs server. 
  136.   
  137.  
  138.