You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by "Ching, Vivian M, ALABS" <vm...@att.com> on 2005/02/24 12:53:39 UTC

socket TIME_WAIT state

If I am using SOAPHTTPConnection to send and receive soap
messages.  My question is: when are the socket connections 
released?  Do I have to do anything explicitly to close it?  
Server ends says the socket is going into TIME_WAIT state (sometimes?).
Will this happen if client timesout before response is received?
I am on jdk1.3.  Thanks for any help!
 
 
Envelope env = null; 
Message msg = new Message();
SOAPHTTPConnection st = new SOAPHTTPConnection();
msg.setSOAPTransport(st);
st.setTimeout(2000);
 
try {
msg.send(new URL(sURL), soapAction, requestEnvelope);
env = msg.receiveEnvelope();
} 
 
 
Vivian Ching
AT&T
MT A2-2E04
200 S Laurel Avenue
Middletown, NJ 07748
732.420.2452  
 
 

Re: socket TIME_WAIT state

Posted by Achim Grolms <ac...@grolmsnet.de>.
On Thursday 24 February 2005 12:53, Ching, Vivian M, ALABS wrote:
> If I am using SOAPHTTPConnection to send and receive soap
> messages.  My question is: when are the socket connections
> released?  

Have a look to src/org/apache/soap/util/net/HTTPUtils.java :

at the end of post( ... )

You will find that the socket is closed at the and of every call
of post(...):

      /* All done here! */
      bOutStream.close();
      outStream.close();
      bInStream.close();
      inStream.close();
->    s.close();
      return response;


HTH, Achim

Re: socket TIME_WAIT state

Posted by Scott Nichol <sn...@scottnichol.com>.
Stevens' "TCP/IP Illustrated, Volume 1" has the TCP state transition diagram.  It is p. 241 in my edition.  For a SOAP client, the app leaves the ESTABLISHED state by requesting a close(), which causes TCP/IP to send a FIN to the server.  There are a couple of ways TCP/IP can then move to the TIME_WAIT state, but it will always pass through that state.  It will stay in that state for 2 * MSL.  MSL is specified in RFC 793 as 2 minutes, but as Stevens notes, some implementations use a different value.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Ching, Vivian M, ALABS" <vm...@att.com>
To: <so...@ws.apache.org>
Sent: Thursday, February 24, 2005 6:53 AM
Subject: socket TIME_WAIT state


If I am using SOAPHTTPConnection to send and receive soap
messages.  My question is: when are the socket connections 
released?  Do I have to do anything explicitly to close it?  
Server ends says the socket is going into TIME_WAIT state (sometimes?).
Will this happen if client timesout before response is received?
I am on jdk1.3.  Thanks for any help!
 
 
Envelope env = null; 
Message msg = new Message();
SOAPHTTPConnection st = new SOAPHTTPConnection();
msg.setSOAPTransport(st);
st.setTimeout(2000);
 
try {
msg.send(new URL(sURL), soapAction, requestEnvelope);
env = msg.receiveEnvelope();
} 
 
 
Vivian Ching
AT&T
MT A2-2E04
200 S Laurel Avenue
Middletown, NJ 07748
732.420.2452