home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / vmsnet / networks / tcpip / ucx / 88 < prev    next >
Encoding:
Text File  |  1992-08-30  |  3.0 KB  |  80 lines

  1. Xref: sparky vmsnet.networks.tcp-ip.ucx:88 vmsnet.networks.tcp-ip.multinet:2070
  2. Newsgroups: vmsnet.networks.tcp-ip.ucx,vmsnet.networks.tcp-ip.multinet
  3. Path: sparky!uunet!eco.twg.com!eco.twg.com!reece
  4. From: reece@eco.twg.com (Reece R. Pollack)
  5. Subject: Re: Do UCX and Multinet support nonblocking I/O?
  6. Message-ID: <1992Aug31.053934.16744@eco.twg.com>
  7. Lines: 64
  8. Sender: reece@flash.eco.twg.com (Reece R. Pollack)
  9. Nntp-Posting-Host: eco.twg.com
  10. Reply-To: reece@eco.twg.com (Reece R. Pollack)
  11. Organization: The Wollongong Group (East Coast Operations)
  12. References:  <dank.715215744@blacks>
  13. Date: Mon, 31 Aug 92 05:39:34 GMT
  14. Lines: 64
  15.  
  16.  
  17. In article <dank.715215744@blacks>, dank@blacks.jpl.nasa.gov (Daniel R. Kegel) writes:
  18. |>Hi,
  19. |>I want to port to VMS a Unix program which initiates several
  20. |>connections to TCP servers and uses nonblocking I/O
  21. |>to manage all the connections simultaneously.
  22. |>
  23. |>Questions:
  24. |>1) Will a program written for one style of TCP/IP (UCX, Multinet, CMU/TEK)
  25. |>   run or compile for another style of TCP/IP, or are they wildly incompatible?
  26.  
  27. Most, if not all, TCP/IP implementations for VMS offer some varient of
  28. the BSD socket interface. As such, they are fairly close in features.
  29. However, the routine names vary from implementation to implementation.
  30.  
  31. For example, the Vax C RTL read() call can be used to read a UCX socket. The
  32. equivalent call for WIN/TCP is netread(), while Multinet uses socket_read().
  33. If you establish a standard function call for reading a socket, you can
  34. use #ifdefs to define a macro which will hide the differences:
  35.  
  36. #ifdef WINTCP
  37. #define sockread(s,b,l)  netread(s,b,l)
  38. #define sockwrite(s,b,l) netwrite(s,b,l)
  39. #endif
  40.  
  41. #ifdef UCX
  42. #define sockread(s,b,l)  read(s,b,l)
  43. #define sockwrite(s,b,l) write(s,b,l)
  44. #endif
  45.  
  46. #ifdef MULTINET
  47. #define sockread(s,b,l)  socket_read(s,b,l)
  48. #define sockwrite(s,b,l) socket_write(s,b,l)
  49. #endif
  50.  
  51. Both Multinet and WIN/TCP (or Pathway for VMS, as it is now called) offer
  52. a UCX emulation mode which allows a program written to use the Vax C RTL
  53. calls to run over non-UCX transports.
  54.  
  55.  
  56. |>2) Can select() or poll() be used with tcp/ip sockets to detect which of a 
  57. |>   set of sockets is ready for I/O?
  58.  
  59. Yes, although select usually will only work on sockets and not terminals
  60. and files and the like. This is often the biggest stumbling block to porting
  61. Unix network applications.
  62.  
  63. |>3) Can one use non-blocking I/O on a socket?  If so, how?
  64.  
  65. WIN/TCP sockets can be put into a non-blocking mode using the ioctl provided
  66. in the WIN/TCP socket library. I don't know how the other products handle
  67. this at the socket library level.
  68.  
  69. Under Unix the scheme is to wait for data to be available using select()
  70. and then reading the data using read(). Under VMS, this is done by queueing
  71. reads to each channel using sys$qio and then waiting for one of the I/Os to
  72. complete, usually using sys$wflor. If you're looking for maximum efficiency
  73. or greater functionality than you can get with the VMS implementations of
  74. select(), converting ti qios is the way to do it.
  75.  
  76. --
  77. Reece R. Pollack
  78. Senior Software Engineer
  79. The Wollongong Group, Inc.
  80.