mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Make sure to report EOF when reading from a socket channel
This commit is contained in:
@ -44,6 +44,7 @@ public class SocketChannel extends SelectableChannel
|
||||
}
|
||||
|
||||
public int read(ByteBuffer b) throws IOException {
|
||||
if (! open) return -1;
|
||||
if (b.remaining() == 0) return 0;
|
||||
int r = natRead(socket, b.array(), b.arrayOffset() + b.position(), b.remaining());
|
||||
b.position(b.position() + r);
|
||||
|
Reference in New Issue
Block a user