Open a tcp socket and continuously read the stream in a non-working way. Items in the stream are seperated by a cartridge return. Please use regex to remove the non numeric characters from the item but allow the decimal point. Add each cleaned item to a public queue named rawData.
private static Queue<string> rawData = new Queue<string>(); private static Queue<int> cleanData = new Queue<int>(); private static Thread receivingThread; private static void StartReceiving() { receivingThread = new Thread(ReceiveData); receivingThread.IsBackground = true; receivingThread.Start(); } private static void ReceiveData() { TcpClient client = new TcpClient("192.168.1.1", 5000); Stream stream = client.GetStream(); byte[] bytes = new byte[1024]; int length; while (true) { length = stream.Read(bytes, 0, bytes.Length); if (length > 0) { string data = Encoding.ASCII.GetString(bytes, 0, length); var cleanDataLines = Regex.Matches(data, @"\d*\.?\d+").Cast<Match>().Select(m