I have 2 connections established from a JMeter instance to an Apache Server, and from the Apache server to a Java application deployed in Jonas.
When I kill the JMeter process, the connection to Apache is closed with a [RST]. Then Apache sends a [FIN, ACK] to Jonas. Jonas has not sent all data, so it keeps sending data. Jonas closes the connection later with a [FIN,ACK]. This behaviour is described in TCP RFC.
So, the problem is Apache receives all data from Jonas, even if Apache can not send it to JMeter.
My question is: Can my Java application be triggered on receipt of the FIN,ACK send from Apache ?
Not directly, eventually java may throw a IOException from the InputStream or OutputStream but this is platform dependent.
there was talk of a "raw sockets" java implementation prior to the release of JDK 7 but somehow I don't think it ever got off the ground.