Connect() public method

public Connect ( ) : void
return void
Example #1
0
 //
 void TransmitMessage(OSC.NET.OSCMessage _msg)
 {
     if (transmitter != null)
     {
         transmitter.Connect();
         transmitter.Send(_msg);
         transmitter.Close();
     }
 }
 public void connect()
 {
     // Reconnect with the new API.
     pUDPWriter = new OSCTransmitter(WiiTUIO.Properties.Settings.Default.tuio_IP, WiiTUIO.Properties.Settings.Default.tuio_port);
     pUDPWriter.Connect();
     if (OnConnect != null)
     {
         OnConnect();
     }
 }
        private void scaOscButton_Click(object sender, EventArgs e)
        {
            scaOscStopButton.Enabled = true;
            scaOscButton.Enabled = false;

            ensureOscilloscope();

            m_oscListenerThread = new Thread(new ThreadStart(oscListenerLoop));
            // see Entry.cs for how the current culture is set:
            m_oscListenerThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; //new CultureInfo("en-US", false);
            m_oscListenerThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; //new CultureInfo("en-US", false);
            m_oscListenerThread.IsBackground = true;	// terminate with the main process
            m_oscListenerThread.Name = "AccelTestOSCListener";
            m_oscListenerThread.Start();

            Thread.Sleep(3000);		// let the oscilloscope start

            int oscPort = Convert.ToInt32(oscPortTextBox.Text);

            oscTransmitter = new OSCTransmitter("localhost", oscPort);

            oscTransmitter.Connect();

            Tracer.Trace("OSC connected and transmitting to port " + oscPort);
        }
Example #4
0
 public void doneCapturePhoto()
 {
     OSC.NET.OSCMessage m = new OSC.NET.OSCMessage("camera_on");
         OSC.NET.OSCTransmitter t = new OSC.NET.OSCTransmitter("localhost", capturePort + 1);
         t.Connect();
         t.Send(m);
 }
        /// <summary>
        /// Connect the UDP transmitter using the port and IP specified above.
        /// </summary>
        /// <returns></returns>
        private bool connectTransmitter(String Host, String Port)
        {
            try
            {
                // Close any open connections.
                disconnectTransmitter();

                // Reconnect with the new API.
                pUDPWriter = new OSCTransmitter(Host, Int32.Parse(Port));
                pUDPWriter.Connect();
                return true;
            }
            catch (Exception pError)
            {
                // Tear down.
                try
                {
                    this.disconnectTransmitter();
                }
                catch { }

                // Report the error.
                System.Console.Error.WriteLine("TUIO Connection Error: " + pError.Message);
                return false;
            }
        }