public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Grant Edwards <grante@visi.com>,
	eCos Discussion <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Re: __tcp_close() can't close connection in Redboot
Date: Wed, 12 Oct 2005 13:28:00 -0000	[thread overview]
Message-ID: <1129123663.4849.72.camel@hermes> (raw)
In-Reply-To: <20051012131604.GA16502@lunn.ch>

On Wed, 2005-10-12 at 15:16 +0200, Andrew Lunn wrote:
> On Wed, Oct 12, 2005 at 07:55:11AM -0500, Grant Edwards wrote:
> > In gmane.os.ecos.general, you wrote:
> > 
> > >   I am trying to build up httpd service in RedBoot.
> > > And I met problem that I can't close connection by
> > > calling __tcp_close() after replying data to
> > > client,and the httpd sock state is always TIME_WAIT.
> > 
> > Right. 
> > 
> > After you close a tcp connection (you send a FIN packet and
> > receive a FIN back) the state is _supposed_ to be TIME_WAIT.
> > 
> > http://tangentsoft.net/wskfaq/articles/debugging-tcp.html
> 
> The purpose of this is to catch old packets still floating around the
> network including retransmitted FIN packets.
> 
> Normally this is not a problem. The server goes back to its listen
> socket and accepts the next connection.  After 2x maximum segment
> lifetime the old socket in TIME_WAIT is destroyed. 
> 
> I don't know the redboot tcp stack. Does it implement the same
> concept? ie simply accept the next connection waiting on the listen
> socket?

RedBoot hangs once it sees the CLOSE_WAIT condition.  You need to
continually call __tcp_poll() which will eventually flush the connection
which then goes to CLOSED.  At that time, you can create a new 
connection.

Note: this code is untested for more than one active TCP connection,
so beware.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2005-10-12 13:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-12 11:19 [ECOS] " Huang Sun I
2005-10-12 12:53 ` [ECOS] " Grant Edwards
2005-10-12 13:16   ` Andrew Lunn
2005-10-12 13:28     ` Gary Thomas [this message]
2005-10-12 13:33       ` Grant Edwards
2005-10-12 13:37         ` Gary Thomas
2005-10-12 15:07           ` Huang Sun I
2005-10-12 13:30     ` Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1129123663.4849.72.camel@hermes \
    --to=gary@mlbassoc.com \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=grante@visi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).