encoder = createEncoder(client);
encoder.write(request);
encoder.flush();
Idle idle = new Idle();
decoder = createDecoder(client, idle);
ResponseMessage response = (ResponseMessage)decoder.read();
boolean hasContent = handleContent(response);
boolean success = handleResponse(response);
if (success && hasContent) {
idle.await(10L, TimeUnit.SECONDS);
}
} catch (Exception err) {
uncaughtException(client, err);
handleException(request, err);