static void Main(string[] args) { WebClient webClient = new WebClient(); string IPaddress = webClient.DownloadString("http://transgame.csail.mit.edu:9537/?varname=jedeyeserver"); TcpClient client = new TcpClient(IPaddress, 1101); TextReader reader = new StreamReader(client.GetStream()); DrawClass dc = new DrawClass(); while (true) { string data = reader.ReadLine(); //Console.WriteLine(data); SensorData sensor = Newtonsoft.Json.JsonConvert.DeserializeObject<SensorData>(data); dc.HandleSensorData(sensor); Console.WriteLine(dc.state); //dc.UpdatePlot(sensor); //Console.WriteLine(dc.ToString()); //Console.WriteLine(sensor); } }
static void Main(string[] args) { WebClient webClient = new WebClient(); string IPaddress = webClient.DownloadString("http://transgame.csail.mit.edu:9537/?varname=jedeyeserver"); TcpClient client = new TcpClient(IPaddress, 1101); TextReader reader = new StreamReader(client.GetStream()); DrawClass dc = new DrawClass(); while (true) { string data = reader.ReadLine(); //Console.WriteLine(data); SensorData sensor = Newtonsoft.Json.JsonConvert.DeserializeObject <SensorData>(data); dc.HandleSensorData(sensor); Console.WriteLine(dc.state); //dc.UpdatePlot(sensor); //Console.WriteLine(dc.ToString()); //Console.WriteLine(sensor); } }