Date: Thu, 10 Sep 1998 18:05:45 +0100 From: james.g.mansion@hsbcgroup.com To: HighWind Software Information <info@highwind.com> Cc: freebsd-current@FreeBSD.ORG Subject: Re: Thread Problems Message-ID: <8025667B.005D1D44.00@hbmdtesmtp1.tex.hsbcmidland.com>
next in thread | raw e-mail | index | archive | help
Without wishing to be too catty - why don't you go and read the reference I gave, which has a discussion of this? As I suggested, maybe? You will see that Stevens notes that 'Berkeley-derived implementations do not return the aborted connection to the server, while other implementations should return ECONNABORTED but often return EPROTO instead' Now, maybe we could argue that 'Berkely-derived implementations' are indeed all wrong in their behaviour here. That is probably the point of Stevens' text anyway, though he doesn't use such a strong statement. My copy of the relevant POSIX draft is at home - but then its just a draft and quite old at that. So its arguable whether the behaviour of any particular system is 'correct' or not. I can't check what it has to say about this in the state transition diagrams. Whether or not there is a bug in libc_r is another matter. My point is that this 'problem' of using select and blocking accepts is known, and documented, and the server code needs to be modified to work on Berkely and non-Berkely implementations. Stevens' book cannot be recommended too highly. The second edition is well worth purchasing, even if you already have the first. James HighWind Software Information <info@highwind.com> on 10/09/98 16:43:40 To: James G MANSION/HBMD/HSBCMERIDIAN cc: freebsd-current@FreeBSD.ORG Subject: Re: Thread Problems The latest edition of Stevens Network Programming has a discussion on this point. The accept should not be done in blocking mode, for exactly the reason suggested below. If you do a blocking accept and the client closes before the connection was complete, accept() should return an error. Then you just loop back into accept again. No harm done. I don't see how this is relevant anyway. The libc_r is supposed to set that fd to non-blocking under the covers. The bug (I believe) is that somehow the fd becomes blocking. I posted a test program that illustrates the problem. See for yourself. -Rob ********************************************************************** This message originated from the Internet. Its originator may, or may not be who they claim to be, and the information contained herein may, or may not be accurate. ********************************************************************** ************************************************************************ Midland Bank plc, who is regulated in the UK by SFA, has issued the information contained in this message (including any attached documents) for its non-private customers only. It should not be reproduced and/or distributed to any other person. It is not an invitation to buy or sell securities. Opinions may change without notice and members of the HSBC Group may have positions in, or trade in instruments mentioned in this message. Each page attached hereto must also be read in conjunction with any disclaimer which form part of it. ************************************************************************ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8025667B.005D1D44.00>