internal void send(ComBuffer com) { int rc; com.end(); for (int size = com.pos, offs = 0; size != 0; size -= rc, offs += rc) { int chunk = size > MaxSendParcelSize ? MaxSendParcelSize : size; rc = socket.Send(com.buf, offs, chunk, SocketFlags.None); if (rc <= 0) { throw new CliError("Socket write failed"); } } }