Exemplo n.º 1
0
		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);
			}
		}
Exemplo n.º 2
0
		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);
			}
		}