You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by saravanan <sa...@yahoo.com> on 2009/03/13 08:06:01 UTC

Regarding HttpConnection's inputstream.readObject()

 Hi,

 We have a client, webserver and server based application(3 entities).
 We open ingress connection from server side using HttpConnection  objects with the webserver. The ingress connection is used  to getRequest from the HttpConnection's inputStream(of Tomcat). Tomcat will create socket object and does a relay  of request from Client to server and vice versa.
 
 At server side For Ingress, we get InputStream of HttpConnection object and do a readObject() for receiving request.
The inputStream we use is ObjectInputStream.readObj().

 The issue is when machine were webserver(Tomcat) is running gets  disconnected from network/network cable is pulled out, we  dont receive any socketException or IOException in  ObjectInputStream.readObj(). Thus we are unable to  recognize  that Tomcat is down.

 Could you please assist me to resolve this.

Regards
Saravanan


      

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Regarding HttpConnection's inputstream.readObject()

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2009-03-16 at 13:33 +0000, James Abley wrote:
> 2009/3/13 saravanan <sa...@yahoo.com>:
> >
> >  Hi,
> >
> >  We have a client, webserver and server based application(3 entities).
> >  We open ingress connection from server side using HttpConnection  objects with the webserver. The ingress connection is used  to getRequest from the HttpConnection's inputStream(of Tomcat). Tomcat will create socket object and does a relay  of request from Client to server and vice versa.
> >
> >  At server side For Ingress, we get InputStream of HttpConnection object and do a readObject() for receiving request.
> > The inputStream we use is ObjectInputStream.readObj().
> >
> >  The issue is when machine were webserver(Tomcat) is running gets  disconnected from network/network cable is pulled out, we  dont receive any socketException or IOException in  ObjectInputStream.readObj(). Thus we are unable to  recognize  that Tomcat is down.
> >
> >  Could you please assist me to resolve this.
> >
> > Regards
> > Saravanan
> >
> 
> This sounds more like a question for the user list than the developer
> list? Please continue any further discussion on the user list. I've
> copied it in.
> 
> Also, have you looked at the HttpClient API to set a timeout on the
> connection? I've found that tends to be a very useful thing to think
> about generally.
> 
> Cheers,
> 
> James
> 

I am not sure taking this question to the user list will help much, as
this question does not seem to be related to HttpComponents in any way.

Oleg 


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Regarding HttpConnection's inputstream.readObject()

Posted by saravanan <sa...@yahoo.com>.
Hi James/Oleg

     We get the HttpConnection object's reponseInputStream and create a objectinputstream  out of it and do a Read object on it.  The HttpConnection with webserver is always on and we doesnt close the connection. The issue is when the webserver pc is removed from network,  to the HttpConnection objectinputStream.readObj doesnt get any SocketException. I think Accessing stream of a HttpConnection which no longer exists should throw SocketException.

    James, as you said setting HttpConnection timeout should fix the issue. But ido have a session timer which kicks in at configured interval which disconnects and connects back freshly. So i didnt introduce timeout for HttpConnection.

Regards
Saravanan


--- On Mon, 3/16/09, James Abley <ja...@gmail.com> wrote:

> From: James Abley <ja...@gmail.com>
> Subject: Re: Regarding HttpConnection's inputstream.readObject()
> To: "HttpComponents Project" <de...@hc.apache.org>, saran_3000@yahoo.com, httpclient-users@hc.apache.org
> Date: Monday, March 16, 2009, 8:33 AM
> 2009/3/13 saravanan <sa...@yahoo.com>:
> >
> >  Hi,
> >
> >  We have a client, webserver and server based
> application(3 entities).
> >  We open ingress connection from server side using
> HttpConnection  objects with the webserver. The ingress
> connection is used  to getRequest from the
> HttpConnection's inputStream(of Tomcat). Tomcat will
> create socket object and does a relay  of request from
> Client to server and vice versa.
> >
> >  At server side For Ingress, we get InputStream of
> HttpConnection object and do a readObject() for receiving
> request.
> > The inputStream we use is ObjectInputStream.readObj().
> >
> >  The issue is when machine were webserver(Tomcat) is
> running gets  disconnected from network/network cable is
> pulled out, we  dont receive any socketException or
> IOException in  ObjectInputStream.readObj(). Thus we are
> unable to  recognize  that Tomcat is down.
> >
> >  Could you please assist me to resolve this.
> >
> > Regards
> > Saravanan
> >
> 
> This sounds more like a question for the user list than the
> developer
> list? Please continue any further discussion on the user
> list. I've
> copied it in.
> 
> Also, have you looked at the HttpClient API to set a
> timeout on the
> connection? I've found that tends to be a very useful
> thing to think
> about generally.
> 
> Cheers,
> 
> James


      

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Regarding HttpConnection's inputstream.readObject()

Posted by James Abley <ja...@gmail.com>.
2009/3/13 saravanan <sa...@yahoo.com>:
>
>  Hi,
>
>  We have a client, webserver and server based application(3 entities).
>  We open ingress connection from server side using HttpConnection  objects with the webserver. The ingress connection is used  to getRequest from the HttpConnection's inputStream(of Tomcat). Tomcat will create socket object and does a relay  of request from Client to server and vice versa.
>
>  At server side For Ingress, we get InputStream of HttpConnection object and do a readObject() for receiving request.
> The inputStream we use is ObjectInputStream.readObj().
>
>  The issue is when machine were webserver(Tomcat) is running gets  disconnected from network/network cable is pulled out, we  dont receive any socketException or IOException in  ObjectInputStream.readObj(). Thus we are unable to  recognize  that Tomcat is down.
>
>  Could you please assist me to resolve this.
>
> Regards
> Saravanan
>

This sounds more like a question for the user list than the developer
list? Please continue any further discussion on the user list. I've
copied it in.

Also, have you looked at the HttpClient API to set a timeout on the
connection? I've found that tends to be a very useful thing to think
about generally.

Cheers,

James

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Regarding HttpConnection's inputstream.readObject()

Posted by James Abley <ja...@gmail.com>.
2009/3/13 saravanan <sa...@yahoo.com>:
>
>  Hi,
>
>  We have a client, webserver and server based application(3 entities).
>  We open ingress connection from server side using HttpConnection  objects with the webserver. The ingress connection is used  to getRequest from the HttpConnection's inputStream(of Tomcat). Tomcat will create socket object and does a relay  of request from Client to server and vice versa.
>
>  At server side For Ingress, we get InputStream of HttpConnection object and do a readObject() for receiving request.
> The inputStream we use is ObjectInputStream.readObj().
>
>  The issue is when machine were webserver(Tomcat) is running gets  disconnected from network/network cable is pulled out, we  dont receive any socketException or IOException in  ObjectInputStream.readObj(). Thus we are unable to  recognize  that Tomcat is down.
>
>  Could you please assist me to resolve this.
>
> Regards
> Saravanan
>

This sounds more like a question for the user list than the developer
list? Please continue any further discussion on the user list. I've
copied it in.

Also, have you looked at the HttpClient API to set a timeout on the
connection? I've found that tends to be a very useful thing to think
about generally.

Cheers,

James

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org