RE: The problem of CLOSE_WAIT
Your application received a FIN before it issued a CLOSE. Maybe your appl should respond with a CLOSE on the socket (if it is detecting the FIN at all) ? This might be nothing for CLOSE_WAIT is a normal state or it might be that your application is not CLOSING the sockets when the other side is initiating the shutdown (which puts them in CLOSE_WAIT). -Original Message- From: David Schwartz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 5:32 AM To: [EMAIL PROTECTED] Subject: Re: The problem of CLOSE_WAIT On Tue, 17 Sep 2002 17:07:06 +0800, Öܹ⻪ wrote: >After few days, on the server side, there are many ssl socket connection >did not exit clean, they are mostly in close_wait state and few in >established state. Do you understand what the CLOSE_WAIT state means and how sockets get in that state? DS __ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] __ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
Re: The problem of CLOSE_WAIT
On Tue, 17 Sep 2002 18:26:05 +0800, 周光华 wrote: >I think CLOSE_WAIT state means it is still waitting for the other side's >FD_CLOSE notification, (perhaps shutdown function of ssl or socket will >send this notification), but the other side had already exit and >successfully closed the connection, (perhaps it exited with exceptions or it >is killed by others). so the server stay in CLOSE_WAIT state always. But >the child process forked by the server has already exit. Nope. This is the TIME_WAIT state, which is another animal entirely. See http://tit.irk.ru/tcp_stevens/tcp_conn.htm and RFC1793. The problem is that you did not close the file descriptor after it was cloned by fork. DS __ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
Re: The problem of CLOSE_WAIT
This page (http://mictlan.sfsu.edu/~dachen/documents/Overview.htm) has a good description of the states. CLOSE_WAIT means that the peer shutdown the connection and the application still has it open. - Original Message - From: "周光华" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 17, 2002 8:26 PM Subject: Re: The problem of CLOSE_WAIT > I think CLOSE_WAIT state means it is still waitting for the other side's > FD_CLOSE notification, (perhaps shutdown function of ssl or socket will > send this notification), but the other side had already exit and > successfully closed the connection, (perhaps it exited with exceptions or it > is killed by others). so the server stay in CLOSE_WAIT state always. But > the child process forked by the server has already exit. > > - Original Message - > From: "David Schwartz" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, September 17, 2002 5:31 PM > Subject: Re: The problem of CLOSE_WAIT > > > > > > On Tue, 17 Sep 2002 17:07:06 +0800, Öܹ⻪ wrote: > > > > >After few days, on the server side, there are many ssl socket connection > > >did not exit clean, they are mostly in close_wait state and few in > > >established state. > > > > Do you understand what the CLOSE_WAIT state means and how sockets get in > > that state? > > > > DS > > > > > > __ > > OpenSSL Project http://www.openssl.org > > Development Mailing List [EMAIL PROTECTED] > > Automated List Manager [EMAIL PROTECTED] > > > > > __ > OpenSSL Project http://www.openssl.org > Development Mailing List [EMAIL PROTECTED] > Automated List Manager [EMAIL PROTECTED] > __ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
Re: The problem of CLOSE_WAIT
I think CLOSE_WAIT state means it is still waitting for the other side's FD_CLOSE notification, (perhaps shutdown function of ssl or socket will send this notification), but the other side had already exit and successfully closed the connection, (perhaps it exited with exceptions or it is killed by others). so the server stay in CLOSE_WAIT state always. But the child process forked by the server has already exit. - Original Message - From: "David Schwartz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 17, 2002 5:31 PM Subject: Re: The problem of CLOSE_WAIT > > On Tue, 17 Sep 2002 17:07:06 +0800, Öܹ⻪ wrote: > > >After few days, on the server side, there are many ssl socket connection > >did not exit clean, they are mostly in close_wait state and few in > >established state. > > Do you understand what the CLOSE_WAIT state means and how sockets get in > that state? > > DS > > > __ > OpenSSL Project http://www.openssl.org > Development Mailing List [EMAIL PROTECTED] > Automated List Manager [EMAIL PROTECTED] > __ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
Re: The problem of CLOSE_WAIT
On Tue, 17 Sep 2002 17:07:06 +0800, Öܹ⻪ wrote: >After few days, on the server side, there are many ssl socket connection >did not exit clean, they are mostly in close_wait state and few in >established state. Do you understand what the CLOSE_WAIT state means and how sockets get in that state? DS __ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
The problem of CLOSE_WAIT
My Dear: I have wrote a sslServer and sslClient class. In the server's main program, create a listenning socket, when an accept socket is setup, then fork a process, then new a sslServer object and pass the socket fd to the sslServer object, then process client's request and answer, before the child exit, delete sslServer object. On the client side, first setup a socket connection with the server, then fork a child, in the child process, new a sslClient object with parent's socket fd, then do request and recieve msg. Before the child exit, delete sslClient object. But a problem come on: After few days, on the server side, there are many ssl socket connection did not exit clean, they are mostly in close_wait state and few in established state. Then, when a client attempt to connect to the server with sslClient object, they failed, and the sslServer failed at SSL_accept with no error msg. After I restart the server program, everything is ok. How I can solve this headache problem! Attachment is my sslServer, sslClient and sslBase class, Is something wrong with them? By the way, It is not me who wrote the server and client programs, I just wrote sslServer, sslClient, sslBase and a program to produce cert and privite key file for the server and client. But I have wrote some simple test program to test my ssl classes, there is no such error phenomenon I discribed up. So headache, Anyone can help me? Thx very much! zhou guanghua __Guanghua ZhouNoICQ#: 163768997 Current ICQ status: ( Home Tel#: No( Work Tel#: No7 Fax#: No+ More ways to contact me __ online?icq=163768997&img=21 Description: Binary data sslClass.zip Description: Binary data