🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Olaf Titz Fri, 11 Aug 1995 00:00
Re: Q: Coding NNTP reader - How do abort requests?
#16986
Author: Olaf Titz
Date: Fri, 11 Aug 1995 00:00
46 lines
3188 bytes
Richard Clayton  <richard@turnpike.com> wrote:
> Just closing down is potentially bad, for unless you concentrate on how 
> you do the closing at the socket level, the server will still be working 
> its way through all the commands you sent and will therefore still be 
> clogging up the link to you with data you are just going to discard. 

Oops. You're right. This can and will happen with a regular TCP close,
i.e. just sending a FIN packet. But it depends on the host which does
the close how it handles the data which comes in after the close.
Under Un*x, if you close the only fd associated with a particular TCP
socket, the system knows that nobody will be able to read data that
still comes in, so it should tell this the other side (send RSTs?)

Just looked into the Linux 1.2.10 kernel: Yes, it seems to send a RST
in this case. This tells the other side to abort the connection
immediately, discarding buffers and notifying the associated process,
with no acknowledge nor waiting. (If the RST gets lost, the next
transmission will of course cause another RST.)

> doing. The "round trip" from deciding to issue a command until you have 
> the answer in your hand is substantial. The only way of getting 
> respectable performance is have multiple commands "in flight" so that 
> the link utilization is high. This is not an issue if you have an 

The optimal case is if you always have an open connection ready to
receive commands at hand. You could try to assure this by keeping
three connections (or rather two and a spare): if you need to issue a
command, grab the free connection. If the other one is still busy,
open the third one. If the second is not needed any more, close it
down. If you have two idle connections, don't do anything about the
"unneeded" one. This tries to minimize the total number of "connect"
operations, which put strain on the server. But beware that even
idleopen connection strain the server too: each one is handled by a
separate process.

(Assuming you always have enough time for the second socket to "come
to rest", most importantly, that you don't do too much concurrently.)

olaf
-- 
___        Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de       ____
__ o           <URL:http://www.inka.de/~bigred/>     <IRC:praetorius>
__/<_              >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads