Example #1
0
        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();
        }
Example #2
0
 /**
  * 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();
 }
Example #3
0
    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.");
            }
        }
    }
Example #4
0
        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();
        }
Example #5
0
        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();
        }
Example #6
0
        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();
        }