In our project we use Undertow in WildFly application server.
Also we set Read Time Out limits for Undertow.
As we can understand, Read Time Out managed by ReadTimeoutStreamSourceConduit class.
At Read Time Out moment will be called IoUtils.safeClose and resources will be closed.
But we want to return message with TimeOut code ( StatusCodes.REQUEST_TIME_OUT ).
How can we properly close Exchange and return code to client as response?

I tried to handle in exchange.getConnection().addCloseListener , but i cant find a way to return code.
Also, i found Test /undertow-core/src/test/java/io/undertow/server/ReadTimeoutTestCase.java, but it doesnt work.