public void ListenerSingleMSG() { var listener = new UDPListener(55555); var sender = new SharpOSC.UDPSender("localhost", 55555); var msg = new SharpOSC.OscMessage("/test/", 23.42f); sender.Send(msg); while (true) { var pack = listener.Receive(); if (pack == null) { Thread.Sleep(1); } else { break; } } listener.Dispose(); }
/** * Stops the listener and stops triggers the stop of the Run function */ public override void Stop() { Logger.Log("Stopping RemoteOSCAdapter"); stopRequested = true; listenerThread.Join(); listener.Dispose(); }
void OnDisable() { if (IsRunning) { if (MUSE_CMD.CloseMainWindow()) { print("muse-io stopped."); MUSE_CMD.Close(); // free ressources } if (listener != null) { listener.Dispose(); print("Listener closed."); } } }
public void ListenerLoadTest() { var listener = new UDPListener(55555); var sender = new SharpOSC.UDPSender("localhost", 55555); var msg = new SharpOSC.OscMessage("/test/", 23.42f); for (int i = 0; i < 1000; i++) sender.Send(msg); for (int i = 0; i < 1000; i++) { var receivedMessage = listener.Receive(); Assert.NotNull(receivedMessage); } listener.Dispose(); }
public void ListenerLoadTest() { var listener = new UDPListener(55555); var sender = new SharpOSC.UDPSender("localhost", 55555); var msg = new SharpOSC.OscMessage("/test/", 23.42f); for (int i = 0; i < 1000; i++) { sender.Send(msg); } for (int i = 0; i < 1000; i++) { var receivedMessage = listener.Receive(); Assert.NotNull(receivedMessage); } listener.Dispose(); }
public void ListenerSingleMSG() { var listener = new UDPListener(55555); var sender = new SharpOSC.UDPSender("localhost", 55555); var msg = new SharpOSC.OscMessage("/test/", 23.42f); sender.Send(msg); while (true) { var pack = listener.Receive(); if (pack == null) Thread.Sleep(1); else break; } listener.Dispose(); }