home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky vmsnet.networks.tcp-ip.ucx:88 vmsnet.networks.tcp-ip.multinet:2070
- Newsgroups: vmsnet.networks.tcp-ip.ucx,vmsnet.networks.tcp-ip.multinet
- Path: sparky!uunet!eco.twg.com!eco.twg.com!reece
- From: reece@eco.twg.com (Reece R. Pollack)
- Subject: Re: Do UCX and Multinet support nonblocking I/O?
- Message-ID: <1992Aug31.053934.16744@eco.twg.com>
- Lines: 64
- Sender: reece@flash.eco.twg.com (Reece R. Pollack)
- Nntp-Posting-Host: eco.twg.com
- Reply-To: reece@eco.twg.com (Reece R. Pollack)
- Organization: The Wollongong Group (East Coast Operations)
- References: <dank.715215744@blacks>
- Date: Mon, 31 Aug 92 05:39:34 GMT
- Lines: 64
-
-
- In article <dank.715215744@blacks>, dank@blacks.jpl.nasa.gov (Daniel R. Kegel) writes:
- |>Hi,
- |>I want to port to VMS a Unix program which initiates several
- |>connections to TCP servers and uses nonblocking I/O
- |>to manage all the connections simultaneously.
- |>
- |>Questions:
- |>1) Will a program written for one style of TCP/IP (UCX, Multinet, CMU/TEK)
- |> run or compile for another style of TCP/IP, or are they wildly incompatible?
-
- Most, if not all, TCP/IP implementations for VMS offer some varient of
- the BSD socket interface. As such, they are fairly close in features.
- However, the routine names vary from implementation to implementation.
-
- For example, the Vax C RTL read() call can be used to read a UCX socket. The
- equivalent call for WIN/TCP is netread(), while Multinet uses socket_read().
- If you establish a standard function call for reading a socket, you can
- use #ifdefs to define a macro which will hide the differences:
-
- #ifdef WINTCP
- #define sockread(s,b,l) netread(s,b,l)
- #define sockwrite(s,b,l) netwrite(s,b,l)
- #endif
-
- #ifdef UCX
- #define sockread(s,b,l) read(s,b,l)
- #define sockwrite(s,b,l) write(s,b,l)
- #endif
-
- #ifdef MULTINET
- #define sockread(s,b,l) socket_read(s,b,l)
- #define sockwrite(s,b,l) socket_write(s,b,l)
- #endif
-
- Both Multinet and WIN/TCP (or Pathway for VMS, as it is now called) offer
- a UCX emulation mode which allows a program written to use the Vax C RTL
- calls to run over non-UCX transports.
-
-
- |>2) Can select() or poll() be used with tcp/ip sockets to detect which of a
- |> set of sockets is ready for I/O?
-
- Yes, although select usually will only work on sockets and not terminals
- and files and the like. This is often the biggest stumbling block to porting
- Unix network applications.
-
- |>3) Can one use non-blocking I/O on a socket? If so, how?
-
- WIN/TCP sockets can be put into a non-blocking mode using the ioctl provided
- in the WIN/TCP socket library. I don't know how the other products handle
- this at the socket library level.
-
- Under Unix the scheme is to wait for data to be available using select()
- and then reading the data using read(). Under VMS, this is done by queueing
- reads to each channel using sys$qio and then waiting for one of the I/Os to
- complete, usually using sys$wflor. If you're looking for maximum efficiency
- or greater functionality than you can get with the VMS implementations of
- select(), converting ti qios is the way to do it.
-
- --
- Reece R. Pollack
- Senior Software Engineer
- The Wollongong Group, Inc.
-