HCOLL-134 better handling of toString() and close() of the TCP connections

This commit is contained in:
Rob Austin
2014-11-20 18:48:58 +00:00
parent 272eaecaf8
commit a8479ee02f
6 changed files with 70 additions and 37 deletions
@@ -996,7 +996,11 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
private Bytes receive(int requiredNumberOfBytes, long timeoutTime) throws IOException {
while (bytes.buffer().position() < requiredNumberOfBytes) {
clientChannel.read(bytes.buffer());
int len = clientChannel.read(bytes.buffer());
if (len == -1)
throw new IORuntimeException("Disconnected to remote server");
checkTimeout(timeoutTime);
}