protected ByteBuffer writeAll(ByteBuffer dst) { int rem = (int)dst.remaining(); while (rem > 0) { int now = sockChan.write(dst); rem -= now; } return(dst); }
protected ByteBuffer writeAll(ByteBuffer dst) { int rem = (int)dst.remaining(); int now = 0; while (rem > 0) { now = sockChan.write(dst); if (now < 0) { //System.Console.Writeline("Write here "); throw new IOException("Remote side closed connection!"); } rem -= now; } return(dst); }