mirror of
https://github.com/corda/corda.git
synced 2025-06-14 13:18:18 +00:00
various refinements to network implementation
The main idea is to make DatagramChannel and *SocketChannel behave in a way that more closely matches the standard, e.g. allow binding sockets to addresses without necessarily listening on those addresses and accept null addresses where appropriate. It also avoids multiple redundant DNS lookups. This commit also implements CharBuffer and BindException, and adds the Readable interface.
This commit is contained in:
@ -48,7 +48,7 @@ class DirectByteBuffer extends ByteBuffer {
|
||||
|
||||
public ByteBuffer put(ByteBuffer src) {
|
||||
if (src instanceof DirectByteBuffer) {
|
||||
checkPut(position, src.remaining());
|
||||
checkPut(position, src.remaining(), false);
|
||||
|
||||
DirectByteBuffer b = (DirectByteBuffer) src;
|
||||
|
||||
@ -69,7 +69,7 @@ class DirectByteBuffer extends ByteBuffer {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
checkPut(position, length);
|
||||
checkPut(position, length, false);
|
||||
|
||||
unsafe.copyMemory
|
||||
(src, baseOffset + offset, null, address + position, length);
|
||||
@ -84,7 +84,7 @@ class DirectByteBuffer extends ByteBuffer {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
checkGet(position, length);
|
||||
checkGet(position, length, false);
|
||||
|
||||
unsafe.copyMemory
|
||||
(null, address + position, dst, baseOffset + offset, length);
|
||||
|
Reference in New Issue
Block a user