コード例 #1
0
 public static void Shutdown()
 {
     if (s_UDPReceiverThread != null)
     {
         s_UDPReceiverThread.Abort();
         s_UDPReceiverThread = null;
     }
     if (s_UdpSendSocket != null)
     {
         s_UdpSendSocket.Close();
         s_UdpSendSocket = null;
     }
     s_PendingMessageLock.Close();
     s_Instance = null;
 }
コード例 #2
0
        public static void Initialize(string broadcastAddress = c_DefaultBroadcastAddress, int udpPort = c_DefaultUdpPort)
        {
            if (s_Instance != null)
            {
                throw new InvalidOperationException("OSCManager is already instantiated!");
            }
            s_Instance         = new OSCManager();
            s_UDPPort          = udpPort;
            s_BroadcastAddress = broadcastAddress;

            s_PendingMessages    = new List <OSCMessage>();
            s_PendingMessageLock = new Mutex();
            s_UDPReceiverThread  = new Thread(new ThreadStart(UDPReceiverThread))
            {
                Name = "UDPReceiverThread"
            };
            s_UDPReceiverThread.Start();
        }