Ejemplo n.º 1
0
 /// <summary>
 /// Disconnects the socket
 /// </summary>
 public void disconnect()
 {
     connected = false;
     if (receiver != null)
     {
         receiver.Close();
     }
     receiver = null;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Connects the socket and starts the listenning thread
        /// </summary>
        /// <param name="_port">port where the socket will be listenning</param>
        public void connect(int _port)
        {
            port          = _port;
            connected     = false;
            paquets_queue = new Queue <OscPacket>();

            try
            {
                receiver  = new OSCReceiver(port);
                thread    = new Thread(new ThreadStart(listen));
                connected = true;
                thread.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine("failed to connect to port " + port);
                Console.WriteLine(e.Message);
            }
        }