點解server 做緊streaming, NetworkStream.read is blocking?
C#, tcp client..
- NetworkStream stream = client.GetStream();
- byte[] buffer = new byte[640 * 480];
- int read, total = 0;
-
- // Blocking Read here
- while ((read = stream.Read(buffer, total, 1000)) != 0)
- {
- total += read;
- }
複製代碼 |
|
|