home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.protocols.tcp-ip.ibmpc
- Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watserv1!steam.uwaterloo.ca!eengelke
- From: eengelke@steam.uwaterloo.ca (Erick Engelke)
- Subject: Re: tcp-ip library nonblocking I/O (Berkeley compatible)?
- Message-ID: <Btx5J4.2tD@watserv1.uwaterloo.ca>
- Sender: news@watserv1.uwaterloo.ca
- Organization: University of Waterloo
- References: <9209011705.AA08725@ftp.com>
- Date: Tue, 1 Sep 1992 21:40:16 GMT
- Lines: 63
-
-
- I wrote:
- >>Yes, with one exception. I believe FTP's PC/TCP does not support the
- >>use of select to asynchronously detect the establishment of a connection
- >>on a listenning socket. Someone will surely correct me if I'm wrong.
-
- and James (jbvb@ftp.com) corrected it with:
- >Unless the code is buggy (and inspection doesn't reveal anything obvious),
- >we should report a listening socket with connections available for accept()
- >as readable.
-
- My confusion came from the fact that FTP's PC/TCP supplies two inteface
- layers, one is pretty BSD-ish, the other is certainly more homegrown.
- The latter has the select limitation while the BSD-ish one does not.
-
- Before anyone interprets this apparently dual API as being a kludge,
- let me explain why it exists. Every DOS based TCP implementation has
- had to deal with the seemingly innumerable problems of fitting everything
- into a TSR and dealing with DOS's memory/file services and the lack
- thereof. What does that mean? They cannot allocate buffers on the
- fly, they cannot necessarily do DOS i/o due to the re-entrancy of DOS,
- and mapping tcp/ip i/o directly into the filespace (like unix does)
- is possible in part, but not fully.
-
- So all the popular TCP systems use a low-level homegrown API to do the
- real communication between user applications and the TCP/IP kernel,
- but they hide this layer underneath a BSD 4.1 or 4.3-ish set of function
- calls.
-
- Many products only provide the BSD-ish layer for external developers,
- that encourages them to use only documented facilities and makes the
- product look nice so the TCP author doesn't look like he had to make
- the kludges that are actually so necessary.
-
- But in doing so, these products force TSR developers to link in
- extra bulky functions, and in the case of at least one library,
- use a malloc(), a definate no-no in tsr development!
-
- The solution? FTP provides their BSD environment (with source which
- maps it to their internal api) and documents their internal API too.
- That tries to make everyone happy.
-
- Their internal API can be called practically any time.
- Compeditors systems which only provide the BSD-ish interface
- can rarely be called during DOS i/o, and sometimes have difficulty
- when called during interrupt calls.
-
- I've done TSRs with many of the network stacks, using BSD and
- internal APIs. Here's my advice:
-
- If you are developing a non-TSR: stick to the BSD interface,
- it buys you compatibility.
-
- If you are doing a TSR: use the lowest level interface you
- can find for each vendor's product, and be prepared to do
- a lot of debugging. Or hire someone else to do the dirty
- work...
-
- Erick
- --
- Erick Engelke Engineering Computing
- University of Waterloo
- Waterloo TCP Architect erick@development.watstar.uwaterloo.ca
-