home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3876 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  4.7 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!wupost!rice!nb.rockwell.com!wade
  2. From: wade@nb.rockwell.com (Wade Guthrie)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: Sockets vs. TLI (Summary)
  5. Message-ID: <1992Jul23.212455.7993@nb.rockwell.com>
  6. Date: 23 Jul 92 21:24:55 GMT
  7. Article-I.D.: nb.1992Jul23.212455.7993
  8. Sender: wade@nb.rockwell.com (Wade Guthrie)
  9. Organization: Rockwell International
  10. Lines: 112
  11.  
  12.  
  13.  
  14.  
  15. Originally, I asked:
  16.  >the [Sun] documentation (Sun) says "Don't use sockets, you idiot, use TLI".
  17.  >Why, and what's the difference?
  18.  
  19. Thanks to the following people (and, if there are others that I missed, I'm
  20. sorry):
  21.  
  22.     ables@hal.com            (King Ables)
  23.     kucharsk@anthrax.Solbourne.COM    (William Kucharski)
  24.     lebrun@ll.mit.edu        (Steven F. LeBrun)
  25.     barmar@think.com        (Barry Margolin)
  26.     melennec@stna7.stna7.stna.dgac.fr (Ronan Melennec STNA 7S p8240 BD22)
  27.     harry@wsl.ie            (Harry Moreau)
  28.     lypr@is-triton.gwl.com        (Lyn Price)
  29.     rstevens@noao.edu        (W. Richard Stevens)
  30.     john@jwt.UUCP            (John Temples)
  31.  
  32. I got the following responses (in summary):
  33.  
  34. Universally, the consensus was to get W. Richard Stevens' book "UNIX
  35. Network Programming" which contains excellent descriptions of both
  36. socket and TLI programming.  I bought the book ($51, ouch), and it *IS*
  37. excellent.
  38.  
  39. Technically there is very little difference as far as performance or
  40. anything like that.  As regards reliability, there isn't much
  41. difference.  The main difference is in reference to support and
  42. portability; socket support has been slipping for years and TLI is the
  43. new and "accepted" way of doing things.  However, in the POSIX 1003.12
  44. draft they claim that a survey they took showed equal usage of sockets
  45. and TLI, hence they're supporting both.  Yet in survey after survey
  46. (informal) that [one responder to the above question] takes when he
  47. teaches network programming classes, he continually finds 95% of the
  48. people use sockets, 5% use TLI, and half of the 5% are AT&T employees
  49. who don't have a choice.
  50.  
  51. There is also a question of the number of types of networks supported
  52. by each.  Some say that sockets provides a more limited set of network
  53. types; others disagree.
  54.  
  55.  
  56. -----------------------------
  57. Right now:
  58.  
  59. One good reason for sockets is that it is available on more computers.
  60. There are many operating systems that support sockets and not TLI and
  61. there are some operating systems that support both.  On Suns (see below),
  62. there is an issue of quality of implementation as well.
  63.  
  64. -----------------------------
  65. In the future:
  66.  
  67. The TLI is today considered the "standard" interface for networking.
  68. If you write for sockets now, your code will be unportable in a short
  69. time.  If you write in TLI, you have a good chance of porting it
  70. later.
  71.  
  72. -----------------------------
  73. In the "It's all in the implementation" department:
  74.  
  75. In SunOS 4.x sockets should be slightly more efficient than TLI, since
  76. the kernel implements those operations directly, while TLI is a library
  77. layered on top of these system calls.
  78.  
  79. In System V, however, sockets are a library layered on top of TLI.
  80.  
  81. On SUN computers, [TLI is implemented in terms of sockets] In the new
  82. SunOS, it is TLI that is implemented at the kernal level and sockets
  83. are implemented using TLI.  I am not sure at what point in the SUN
  84. operating system, this switch was or is suppost to take place.  I
  85. believe that I obtained this information from one of the USENET
  86. newsgroups when the question arose about the statement in the SUN
  87. manuals that state that you should use TLI instead of sockets.
  88.  
  89. -----------------------------
  90. On SUNS (My particular problem):
  91.  
  92. SEVERAL PEOPLE SAID THE FOLLOWING: Sun admitted that that clause of the
  93. documentation was a MISTAKE and you should ignore it.
  94.  
  95. Under SunOS 4.1.x TLI is a hack at best.  Going TLI now will be nothing
  96. but a source of headaches and will cause you to wonder why your Sun
  97. panics on seemingly innocuous TLI code.
  98.  
  99. [One person found...] Under [Sun OS] 4.1.1, there is no way to cleanly
  100. terminate a connection if you can't tell when transmission is complete
  101. (something our application had no way of doing). Sun eventually sent me
  102. a jumbo patch which does not fix the problem - here's the README
  103. section on this bug:
  104.  
  105. BUGID:1037715
  106.         TCPTLI mistakely indicated ISO orderly release is supported,
  107.         but actually, it is not. The fix now prompts the error
  108.         of "feature not supported".
  109.  
  110. -----------------------------
  111. What I did:
  112.  
  113. Well, since I was starting with a Sun, I decided that (no matter what
  114. other issues were involved) since there is a reliability problem with
  115. TLI on that platform, I'd use sockets.  One neat thing about sockets is
  116. that quite a bit of existing code exists (and is being posted to the
  117. net).  I used this to get me started.
  118.  
  119. Thanks again to everyone who responded.
  120.  
  121. --
  122. Wade Guthrie
  123. wade@nb.rockwell.com
  124.