No exception when writing closed connection response

I have a simple JBoss 5.1 servlet. There is no exception when writing the answer if the connection is closed. Connection closed by read timeout, outside.

JBoss receives FIN, ACK, ACK and after a few seconds sends my response (PSH, ACK) and receives RST.

How to determine in the servlet that the connection is closed and / or the response was not successful?

0


source to share


1 answer


If you write enough data that you are still writing after receiving the RST, you will get an IOException: 'connection reset by peer'. TCP buffering and asynchronous write means this might not happen for a small write.



0


source







All Articles