home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / protocol / tcpip / ibmpc / 4961 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  2.2 KB

  1. Xref: sparky comp.protocols.tcp-ip.ibmpc:4961 comp.sys.mac.programmer:14768
  2. Path: sparky!uunet!dtix!darwin.sura.net!wupost!usc!sdd.hp.com!elroy.jpl.nasa.gov!dank
  3. From: dank@blacks.jpl.nasa.gov (Daniel R. Kegel)
  4. Newsgroups: comp.protocols.tcp-ip.ibmpc,comp.sys.mac.programmer
  5. Subject: tcp-ip library nonblocking I/O (Berkeley compatible)?
  6. Message-ID: <dank.715232338@blacks>
  7. Date: 31 Aug 92 03:38:58 GMT
  8. References: <1992Aug24.125112.14506@info.ucl.ac.be> <BtJy7I.HBL@watserv1.uwaterloo.ca>
  9. Sender: news@elroy.jpl.nasa.gov (Usenet)
  10. Organization: Image Analysis Systems Group, JPL
  11. Lines: 39
  12. Nntp-Posting-Host: blacks.jpl.nasa.gov
  13.  
  14. eengelke@sail.uwaterloo.ca (Erick Engelke) writes:
  15. >I hate to tell you this, but even the nicest BSD emulation libraries
  16. >lack a lot of the BSD feel...
  17. >Novell LWP includes a nice BSD 4.2 Windows emulation library.  FTP is just
  18. >offerring a new release, so I expect they added Windows support, ask
  19. >at info@ftp.com.  B&W's otherwise attractive product is lacking BSD 4.2
  20. >emulation in either DOS or Windows...
  21.  
  22. Perhaps Erick or another TCP/IP guru can answer some related questions.
  23. I want to port to the Mac and to MS-DOS (not neccesarily Windows) a Unix 
  24. program which initiates several connections to TCP servers and uses 
  25. nonblocking I/O to manage all the connections simultaneously.
  26.  
  27. Questions:
  28. 1) Can select() or poll() be used with tcp/ip sockets to detect which of a
  29.     set of sockets is ready for I/O?
  30.  
  31. 2) Can one use non-blocking I/O on a socket?    If so, how?
  32.    In UNIX, one does the following:
  33.  
  34.       fd = socket(hp->h_addrtype, SOCK_STREAM, 0);
  35.       /* Use non-blocking I/O on this socket */
  36.  #if USE_FIONBIO      /* some unix systems use ioctl to set nonblocking...*/
  37.       ioctl(fd, FIONBIO, (char *)&state);
  38.  #else              /* others use fcntl() */
  39.       flags = fcntl(fd, F_GETFL, 0);
  40.       flags |= FNDELAY;
  41.       fcntl(fd, F_SETFL, &flags);
  42.  #endif
  43.       /* Start connecting to the host.  May get EINPROGRESS. */
  44.       err = connect(fd, (struct sockaddr *)&sin, sizeof(sin));
  45.  
  46.    Will this work in any of the popular IBM-PC tcp/ip packages?
  47.    (FYI, the answer for TGV's Multinet under VMS is a qualified yes.
  48.     I'd also like to know the answer for MacTCP.)
  49.  
  50. I'll summarize any answers.
  51. Thanks,
  52.    Dan Kegel (dank@blacks.jpl.nasa.gov)
  53.