The read loop on another thread will read the CLOSE_WAIT response from the server, and so our flushAndReadResponse call might block waiting for a response for up to ~35 seconds (The default heartbeat connection timeout).
Instead, just fire off the write command, and then have the read loop handle stopping the loop correctly.
The read loop on another thread will read the
CLOSE_WAIT
response from the server, and so ourflushAndReadResponse
call might block waiting for a response for up to ~35 seconds (The default heartbeat connection timeout).Instead, just fire off the write command, and then have the read loop handle stopping the loop correctly.