hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malaka Gallage <mpgall...@gmail.com>
Subject Throwing an IO Exception When Client Close the Connection (http-nio4.4)
Date Sun, 29 Mar 2015 14:31:37 GMT
Hello everyone,

I'm migrating from http-nio 4.2.5 to 4.4 and am having some issue with the
following scenario.

Some client sends a request and when the server send the response, client
has closed the connection. The connection state is FIN_WAIT2 --> CLOSE_WAIT.

In 4.2.5 it throws an IO Exception on this scenario but 4.4 does not throw
any exception. I tried to debug the code and realized that the problem is,
in 4.2.5 it first writes only the response headers and when it tries to
write the response body it trows the IO Exception. But in 4.4, it writes
the response headers and the payload together and then it can not know the
connection is closed. So the exception is not thrown. The major differences
are on this method.


Is there anyway I can tune the code to achieve my goal?




*Malaka GallageSoftware Engineer*

*AdroitLogic Lanka (Pvt) Ltd.*
[image: Facebook] <https://www.facebook.com/malaka.gallage> [image: Twitter]
<http://twitter.com/#%21/MalakaGallage> [image: LinkedIn]
<http://www.linkedin.com/profile/view?id=91872322&trk=tab_pro> [image:
Blogger] <http://swordofpoet.blogspot.com/>
Skype :  malaka.gallage
Mobile : +94 718 796 378

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message