//called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            FOutput.SliceCount = SpreadMax;

            if (FInput[0] == "")
                return;

            OSCReceiver rx =new OSCReceiver();
            for (int i = 0; i < SpreadMax; i++)
                FOutput[i] = FInput[i].Replace("c#", "vvvv");

            FLogger.Log(LogType.Debug, "Logging to Renderer (TTY)");
        }
		/// <summary>
		/// Connect the client and server.
		/// </summary>
		/// <param name="portNumber">Port number to listen on.</param>
		public void Connect (int portNumber)
		{
			connected = true;
			client.Connect ();

			server = new OSCReceiver (portNumber);
			server.Connect ();

			//server loop
			Task.Run (() => {
				while (connected) {
					var packet = server.Receive ();

					if (PacketReceived != null)
						PacketReceived (this, packet);
				}
				server.Close ();
			});
		}
Exemple #3
0
		void Open()
		{
			Close();
			try
			{
				FServer = new OSCReceiver(FPinInPort[0]);
				FServer.Connect();

				FRunning = true;
				FThread = new Thread(ThreadedFunction);
				FThread.Start();

				FPinOutStatus[0] = "OK";
			}
			catch (Exception e)
			{
				Close();
				FPinOutStatus[0] = e.Message;
			}
		}
Exemple #4
0
		public void StopListeningOSC()
		{
			if (FThread != null && FThread.IsAlive)
			{
				FListening = false;
				//FOSCReceiver is blocking the thread
				//so waiting would freeze
				//shouldn't be necessary here anyway...
				
				//FThread.Join();
			}

			if (FOSCReceiver != null) FOSCReceiver.Close();
			FOSCReceiver = null;
		}
Exemple #5
0
		public void StartListeningOSC(int UDPPort)
		{
			FOSCReceiver = new OSCReceiver(UDPPort);
			FListening = true;
			FThread = new Thread(new ThreadStart(ListenToOSC));
			FThread.Start();
		}
Exemple #6
0
		void Close()
		{
			if (FRunning)
			{
				FRunning = false;
				FThread.Abort();

				FServer.Close();
				FServer = null;
			}
		}
Exemple #7
0
        void StopOSCReceiver()
        {
            FListening = false;

            //should join here but oscreiver blocks
            //todo: add receivetimeout to oscreceiver
            //            FOSCListener.Join();
            if (FOSCReceiver != null)
                FOSCReceiver.Close();

            FOSCReceiver = null;
        }
Exemple #8
0
        void StartOSCReceiver()
        {
            try
            {
                FOSCReceiver = new OSCReceiver((int) ReceivePortNumberBox.Value);
                FOSCListener = new Thread(new ThreadStart(ListenToOSC));

                FListening = true;
                FOSCListener.Start();
            }
            catch
            {}
        }
Exemple #9
0
		void Close()
		{
			if (FRunning)
			{
				FRunning = false;
				if (!FThread.Join(1000))
				{
					FThread.Abort();
				}

				FServer.Close();
				FServer = null;
			}
		}