home *** CD-ROM | disk | FTP | other *** search
- X-Gateway-Source-Info: INTERNET
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!network.ucsd.edu!mvb.saic.com!tgv.com!info-multinet
- Date: 31 AUG 92 03:02:57 GMT
- Newsgroups: vmsnet.networks.tcp-ip.multinet
- X-Return-path: <info-multinet-relay@TGV.COM>
- X-RFC822-From: adelman (Kenneth Adelman) @ TGV.COM
- From: adelman@TGV.COM
- Subject: Re: Do UCX and Multinet support nonblocking I/O?
- Organization: The INFO-MULTINET Community
- Message-ID: <2460095431AUG92030257@TGV.COM>
- Nntp-Posting-Host: Mvb.Saic.Com
- Lines: 44
-
- > 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?
-
- Mildly incompatible. For the most part each vendor implements a
- 4.3bsd socket library, but has changed the names of the routines in
- different ways so as to not conflict with the VAX C routines like
- "read()".
-
- You should also be able to take images COMPILED for UCX and run
- them over MultiNet with no problem using our UCX emulation.
-
- > 2) Can select() or poll() be used with tcp/ip sockets to detect which of a
- > set of sockets is ready for I/O?
-
- MultiNet provides a select(); note however that our select() can
- only be used on network sockets (and not, for example, terminals).
-
- > 3) Can one use non-blocking I/O on a socket? If so, how?
- > In UNIX, one does the following:
-
- > fd = socket(hp->h_addrtype, SOCK_STREAM, 0);
- > /* Use non-blocking I/O on this socket */
- > #if USE_FIONBIO /* some unix systems use ioctl to set nonblocking...*/
- > ioctl(fd, FIONBIO, (char *)&state);
- > #else /* others use fcntl() */
- > flags = fcntl(fd, F_GETFL, 0);
- > flags |= FNDELAY;
- > fcntl(fd, F_SETFL, &flags);
- > #endif
- > /* Start connecting to the host. May get EINPROGRESS. */
- > err = connect(fd, (struct sockaddr *)&sin, sizeof(sin));
-
- > Will this work under VMS with UCX (or Multinet, or...)?
-
- With Multinet, yes, with UCX I'm not sure. The FIONBIO ioctl()
- is provided, fnctl() is not.
-
- Ken
-