Close() 공개 메소드

Closes the server and terminates its listener thread.
public Close ( ) : void
리턴 void
예제 #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;
 }
예제 #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;
        }