Beispiel #1
0
        public void sendMessage(String address, String data)
        {
            OscBundle  bundle  = new OscBundle(solidworksPlugin);
            OscMessage message = new OscMessage(solidworksPlugin, address, data);

            bundle.Append(message);
            bundle.Send(openFrameworks);
        }
Beispiel #2
0
    //  sends the messages stored in messagesThisFrame as a bundle, then clears messagesThisFrame
    private void SendBundle()
    {
        OscBundle frameBundle = new OscBundle(localEndPoint);

        foreach (OscMessage message in messagesThisFrame)
        {
            frameBundle.Append(message);
        }
        //UnityEngine.Debug.Log("sending bundle");
        frameBundle.Send(externalEndPoint);

        messagesThisFrame.Clear();
    }
Beispiel #3
0
        public void RunWorker()
        {
            try
            {
                while (sSendMessages)
                {
                    while (_oscMessageQueue.Count == 0)
                    {
                        Thread.Sleep(1000);
                    }

                    OscBundle bundle = (OscBundle)_oscMessageQueue.Dequeue();

                    switch (TransportType)
                    {
                    case TransportType.Udp:
                        bundle.Send(Destination);
                        break;

                    case TransportType.Tcp:
                        bundle.Send();
                        break;
                    }

                    Thread.Sleep(10);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            if (TransportType == TransportType.Tcp)
            {
                sOscClient.Close();
            }
        }
 public static void SendOSCMessages(List<string> Addresses)
 {
     sourceEndPoint = new IPEndPoint(serverIPAddress, 53000);
     OscBundle bundle = new OscBundle(sourceEndPoint);
     foreach (string Address in Addresses)
         bundle.Append(OSCMessage.CreateMessage(Address));
     bundle.Send(sourceEndPoint);
 }