Various bug fixes and optimizations

This commit is contained in:
Eric Scharff
2007-10-11 15:41:23 -06:00
parent 75c51bb5ec
commit 00cfa587bc
3 changed files with 44 additions and 7 deletions

View File

@ -57,6 +57,7 @@ public class SocketChannel extends SelectableChannel
if (! connected) {
natThrowWriteError(socket);
}
if (b.remaining() == 0) return 0;
int w = natWrite(socket, b.array(), b.arrayOffset() + b.position(), b.remaining());
if (w > 0) {
b.position(b.position() + w);