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

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