private void clientComm() { while (Thread.CurrentThread.IsAlive) { try { KClientPaquet cp = new KClientPaquet(client.GetStream()); string s = cp.getQuery(); System.Console.WriteLine("Query : " + s); KQuery q = new KQuery(cp.getQuery(),client.GetStream()); byte code = q.process(); KServerPaquet sp = new KServerMessagePaquet(code, q.action.rData); sp.send(client.GetStream()); } catch (KActionException e) { Console.WriteLine(e.exceptionNumber); KServerPaquet sp = new KServerMessagePaquet(222, "SMURK"); sp.send(client.GetStream()); } catch (Exception e) { System.Console.WriteLine("Error : " + Thread.CurrentThread.Name + " : " + e.Message); break; } } closeClient(); }
private void clientComm() { while (Thread.CurrentThread.IsAlive) { try { KClientPaquet cp = new KClientPaquet(client.GetStream()); string s = cp.getQuery(); System.Console.WriteLine("Query : " + s); KQuery q = new KQuery(cp.getQuery(), client.GetStream()); byte code = q.process(); KServerPaquet sp = new KServerMessagePaquet(code, q.action.rData); sp.send(client.GetStream()); } catch (KActionException e) { Console.WriteLine(e.exceptionNumber); KServerPaquet sp = new KServerMessagePaquet(222, "SMURK"); sp.send(client.GetStream()); } catch (Exception e) { System.Console.WriteLine("Error : " + Thread.CurrentThread.Name + " : " + e.Message); break; } } closeClient(); }
public void KinectSensorsStatusChanged(object sender, StatusChangedEventArgs e) { try { KServerPaquet sp = new KServerMessagePaquet(200, "1||" + (byte)e.Status); sp.send(ns); } catch (Exception exc) { System.Console.WriteLine("event statusChanged disconnected : " + exc.Message); sensors.StatusChanged -= KinectSensorsStatusChanged; } }
public void KinectAudioSourceSoundSourceAngleChanged(Object Sender, SoundSourceAngleChangedEventArgs e) { try { string message = new string('0', 0); message += getIdSensor(sensor) + "||"; message += e.Angle + "||" + e.ConfidenceLevel; KServerPaquet sp = new KServerMessagePaquet(206, message.Replace(',', '.')); sp.send(ns); } catch (Exception exc) { System.Console.WriteLine("event AudioSourceBeamAngleChanged disconnected : " + exc.Message); sensor.AudioSource.SoundSourceAngleChanged -= KinectAudioSourceSoundSourceAngleChanged; } }