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]

__tcp_close() can't close connection in Redboot


Hi,
  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.
The client http can't get response from server after
recevive replying.I have to open another client http
to browser,but only once,problem is the same with
above
I described.

The following are rough code structure..
1> into listening state by calling __tcp_listen().

2>Checking TCP incoming connection
httpd_accept()
{
    if (!is_idle) return;
    if (!have_net) return;

    __tcp_poll();
    if (httpd_state != httpd_sock.state) {
        // Something has changed
        if (httpd_sock.state == _ESTABLISHED) {
            // A new connection has arrived
            //check Rx data and response
            // close connection by calling
__tcp_close() .
        }
        if (httpd_sock.state == _CLOSED) {
            // Get ready for another connection
            //into listening state by calling
__tcp_listen().
        }
    }
    httpd_state = httpd_sock.state;      
}
RedBoot_idle(httpd_accept, RedBoot_IDLE_HTTPD/* 6000
*/);


Do I miss any procedure or other way that could fix
it?


thank you!
Huang Sun I


___________________________________________________  最新版 Yahoo!奇摩即時通訊 7.0 beta,免費網路電話任你打!  http://messenger.yahoo.com.tw/beta.html

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