private void as_read() { BinaryReader br = new BinaryReader(ns); while (ns.CanRead) { while (!ns.DataAvailable) System.Threading.Thread.Sleep(33); if (!ns.CanRead) return; int l = br.ReadInt32(); byte[] buffer = new byte[l]; ns.Read(buffer, 0, l); if (receive != null) receive(buffer); } }