You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Janardhanan Vembunarayanan <jv...@gmail.com> on 2006/09/30 20:14:33 UTC

Mina IoSession resue do not working with HTTP Post

 Hi,

  I am using Mina for building a server application. This application will
act as a bridge  between the client and the service provider(a web service).
When the client invokes a service for the first time I create a IoSession to
the service provider and after servicing the client I store the session in
the pool so that I dont need to recreate it and can improve the performance.
But when I try to reuse the Session for the next client request for the same
service it hangs. I wrote a sample program to explain this and it seems to
be working fine for HTTP Get but it is not working working for HTTP post as
the connection is reset by the service provider.

  Any pointers on this?

Regards,
Jana

Re: Mina IoSession resue do not working with HTTP Post

Posted by Trustin Lee <tr...@gmail.com>.
On 10/1/06, Janardhanan Vembunarayanan <jv...@gmail.com> wrote:
>
> Hi,
>
>   I am using Mina for building a server application. This application will
> act as a bridge  between the client and the service provider(a web service).
> When the client invokes a service for the first time I create a IoSession to
> the service provider and after servicing the client I store the session in
> the pool so that I dont need to recreate it and can improve the performance.
> But when I try to reuse the Session for the next client request for the same
> service it hangs. I wrote a sample program to explain this and it seems to
> be working fine for HTTP Get but it is not working working for HTTP post as
> the connection is reset by the service provider.
>
>   Any pointers on this?
>

In your failPost method:

		String httpHeader = "POST / HTTP/1.1  \n"
				+ "User-Agent: Jakarta Commons-HttpnClient/3.1-alpha1 \n"
				+ "Host: junglebook:8090 \n" + "Connection: keep-alive \n"
				+ "\n" + "Content-Length: 5 " + "12345";

Shouldn't it be "Content-Length: 5\n\n"?

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6