This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __tcp_close() can't close connection in Redboot


In gmane.os.ecos.general, you 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. 

Right.  You can reduct that period from 120 seconds to 1 second
by setting the reuse option on the socket.

> 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?

After the 2MSL TIME_WAIT is done, you need to call
__tcp_listen() on the socket to make it listen for a new
connection (accept a SYN packet).  There is no such thing in
RedBoot as a "listen socket" on which pending connections wait.

IOW, you use a single socket structure to both listen for the
connection and communicate via that connection.

-- 
Grant Edwards                   grante             Yow!  FUN is never having
                                  at               to say you're SUSHI!!
                               visi.com            

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]