private static void ReceiveAll (Socket socket, byte [] data, int length) { if (length <= 0) return; int total = 0; while (total < length) { total += socket.Receive (data, total, length - total, System.Net.Sockets.SocketFlags.None); } }
internal static void ReceiveAll (Socket socket, CompatArraySegment<byte> data, int length) { if (length <= 0) return; int total = 0; while (total < length) { total += socket.Receive (data.Array, total + data.Offset, length - total, System.Net.Sockets.SocketFlags.None); } }