Close() public method

Closes the server and terminates its listener thread.
public Close ( ) : void
return void
Esempio n. 1
0
        public bool Open(int port)
        {
            _queue = new Queue <OSCMessage>();
#if UNITY_EDITOR
            if (PlayerSettings.runInBackground == false)
            {
                Debug.LogWarning("Recommend PlayerSettings > runInBackground = true");
            }
#endif
            if (_server != null)
            {
                _server.Close();
            }

            try
            {
                _server = new OSCServer(port);
                _server.SleepMilliseconds    = 0;
                _server.PacketReceivedEvent += didReceivedEvent;
            }
            catch (Exception e)
            {
                Debug.LogError("[" + Name + "] Couldn't open port " + port + " | " + e.Message);
                return(false);
            }

            return(true);
        }
 public void Open(int port)
 {
     if (_server != null)
     {
         _server.Close();
     }
     _server = new OSCServer(port);
     _server.SleepMilliseconds    = 0;
     _server.PacketReceivedEvent += didRecievedEvent;
 }
Esempio n. 3
0
        public void Open(int port)
        {
#if UNITY_EDITOR
            if (PlayerSettings.runInBackground == false)
            {
                Debug.LogWarning("Recommend PlayerSettings > runInBackground = true");
            }
#endif
            if (_server != null)
            {
                _server.Close();
            }
            _server = new OSCServer(port);
            _server.SleepMilliseconds    = 0;
            _server.PacketReceivedEvent += didRecievedEvent;
        }