I've updated the code to handle persistent connections. As best I can figure anyways..
Unfortunately this does not resolve the issue. The server still reports the connection being closed before the full response is read.
The test is done via JMeter. See the perf_test.jmx file. I've confirmed JMeter is include "connection: close" headers in all requests. Which means the persistent connection code is not even being exercised. From instrumenting the code I can confirm this is the case: All requests include "connection: close" and the client never performs a second request using the same stream.
An additional data point: The same test when run with 1 capability (EG: +RTS -N1) does *not* fail. There are no connection close errors. Only when running with multiple capabilities does the test fail.
Cheers,
Corey