home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / protocol / tcpip / 5692 < prev    next >
Encoding:
Text File  |  1992-12-21  |  3.9 KB  |  82 lines

  1. Newsgroups: comp.protocols.tcp-ip
  2. Path: sparky!uunet!psinntp!dg-rtp!tdc!scott
  3. From: scott@tdc.rtp.dg.com (John Scott)
  4. Subject: TLI t_accept behavior (was TLI: t_accept returns TLOOK (why?))
  5. Message-ID: <1992Dec18.171308.918@dg-rtp.dg.com>
  6. Sender: scott@tdc (John Scott)
  7. Date: Fri, 18 Dec 92 17:13:08 GMT
  8. References: <1992Dec2.215556.25482@bnrmtl.bnr.ca> <1992Dec6.034541.7626@phx.mcd.mot.com> <1gnhqsINN1d2@transfer.stratus.com> <1992Dec17.080226.3572@eab.retix.com>
  9. Organization: Data General Corporation, Research Triangle Park, NC
  10. Lines: 70
  11.  
  12. In article <1992Dec17.080226.3572@eab.retix.com>, erik@eab.retix.com (Erik Forsberg) writes:
  13. |> In article <1gnhqsINN1d2@transfer.stratus.com> wendy@sw.stratus.com (Wendy McNaughton) writes:
  14. |> >> In article <1992Dec2.215556.25482@bnrmtl.bnr.ca> kenneth@bnr.ca (Ken Rosenfeld) writes:
  15. |> >> >I'm writing a server using the TLI library for TCP
  16. |> >> >(on a Sun).
  17. |> >> >
  18. |> >> >The server executes the following in a loop:
  19. |> >> >
  20. |> >> >  t_listen(listenfd, ...)        /* receive connect indication */
  21. |> >> >    
  22. |> >> >  t_accept(listenfd, newfd, ...) /* accept the call */
  23. |> >> >
  24. |> >> >There is a case where this code does not work: Two clients
  25. |> >> >make connect requests before the server executes the t_listen().
  26. |> >> >The t_listen() then receives the first connect indication.
  27. |> >> >The t_accept() fails, however, with t_errno = TLOOK.  
  28. |> >> >A subsequent call to t_look() returns the T_LISTEN event.
  29. |> >> >
  30. |> >
  31. |> >I ran into the same situation here with our SVR4-based UNIX (FTX).
  32. |> >Our RPC implementation always assumes that if t_accept() fails
  33. |> >with t_errno = TLOOK, it is as a result of a disconnect (and therefore
  34. |> >calls t_rcvdis).  As Mat Cucuzella pointed out, this is consistent with
  35. |> >the examples in Stevens' UNIX Network Programming book.  I also found
  36. |> >similar examples in the AT&T SVR4 manuals.  
  37. |> >
  38. |> >The consensus here seemed to be that this is incorrect behaviour for
  39. |> >t_accept.  It seems silly to interrupt one connection establishment
  40. |> >just to process another.  Since we have access to the sources, we were 
  41. |> >thinking of modifying our TLI library such that the t_accept call will 
  42. |> >not be interrupted by another connection request.  This seems to work 
  43. |> >well but was wondering if this is the proper thing to do. 
  44. |> >
  45. |> 
  46. |> The MOST proper thing to do is changing TPI implementations to always
  47. |> returning a qlen of 1 to the TLI library on the T_BIND_ACK response
  48. |> message but internally queue up incoming connect indication upto
  49. |> whatever limit you feel like (the original qlen may be a good number).
  50. |> 
  51. |> This avoids that not so cleverly written TLI applications still work
  52. |> even if they get several connect indications at the same time and still
  53. |> being able to handle this.
  54. |> 
  55. |> To simplify what I just said, the net effect is that the TPI Streams
  56. |> driver itself queues many incoming connect indications, but they are
  57. |> presented one at a time to the TLI user. That way the t_look() error
  58. |> will never happen (unless it REALLY IS a disconnect indication).
  59.  
  60. That will work for most TLI clients.  Unfortunately, SVVS is not like most
  61. TLI clients and could score the TPI provider as non-compliant (that is if
  62. USL ever got around to writing a provider test that wasn't full of false
  63. assumptions).
  64.  
  65. |> 
  66. |> All Retix TPI Streams driver operates that way.
  67. |> 
  68. |> 
  69. |> -- 
  70. |> ---------------------------------------------------------------------------
  71. |> Erik Forsberg, erik@eab.retix.com Phone: (310) 476-7133 FAX: (310) 476-7657
  72.  
  73. --
  74. +------------------------------------------------------------------+
  75. | John A. Scott                       | Phone: +1 919 248 5995     |
  76. | Data General                        | Email: scott@dg-rtp.dg.com |
  77. | 62 TW Alexander Drive               |                            |
  78. | Research Triangle Park, NC 27709    |                            |
  79. +------------------------------------------------------------------+
  80.                                                        
  81.  
  82.