Exemple #1
0
        /// <summary>
        /// Test connect click event procedure.
        /// </summary>
        private void Button_Connect_Click(object sender, EventArgs e)
        {
            // set result to default value ..
            resultVar = ConnectResult.NONE;

            // lock controls ..
            this.FormControls(false);

            // analysis server address ..
            IPAddress[] ipadds = Dns.GetHostAddresses(this.TextBox_Server.Text.Trim());
            if (ipadds.Length > 0)
            {
                // assign ip address ..
                this.Addr = ipadds[0];

                // create therad object ..
                __Connect = new System.Threading.Thread(
                    new System.Threading.ParameterizedThreadStart(this.Connecting));

                // start thread process and timer check ..
                __Connect.Start(ipadds[0]);
                __reply.Start();
            }
            else
            {
                MessageBox.Show(this.ParseErrMsg, AssemblyInfoClass.ProductInfo,
                                MessageBoxButtons.OK, MessageBoxIcon.Error);

                // unlock controls ..
                this.FormControls(true);

                return;
            }
        }
Exemple #2
0
 public void Dispose()
 {
     if (this.m_Thread != null)
     {
         try
         {
             this.m_Finished = true;
             if (this.m_WaveOut != global::System.IntPtr.Zero)
             {
                 global::WaveLib.WaveNative.waveOutReset(this.m_WaveOut);
             }
             this.m_Thread.Join();
             this.m_FillProc = null;
             this.FreeBuffers();
             if (this.m_WaveOut != global::System.IntPtr.Zero)
             {
                 global::WaveLib.WaveNative.waveOutClose(this.m_WaveOut);
             }
         }
         finally
         {
             this.m_Thread  = null;
             this.m_WaveOut = global::System.IntPtr.Zero;
         }
     }
     global::System.GC.SuppressFinalize(this);
 }
Exemple #3
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked {
                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                switch (hash)
                {
                case 889051340:
                {
                                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    this.messages = ((global::sys.thread.Deque)(@value));
                                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    return(@value);
                }


                case 572311959:
                {
                                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    this.native = ((global::System.Threading.Thread)(@value));
                                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    return(@value);
                }


                default:
                {
                                                #line 60 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
                        #line default
        }
Exemple #4
0
 public Player(string toip, int pr)
 {
     this._portReceive = pr;
     this._ToIP        = toip;
     this.ThreadListen = new global::System.Threading.Thread(this.DataReceive);
     this.ThreadListen.Start();
     this.ThreadListen.Suspend();
 }
Exemple #5
0
 public WaveOutPlayer(int device, global::WaveLib.WaveFormat format, int bufferSize, int bufferCount, global::WaveLib.BufferEventHandler fillProc)
 {
     this.m_BufferProc = new global::WaveLib.WaveNative.WaveDelegate(global::WaveLib.WaveNative.WaveOutBuffer.WaveOutProc);
     this.m_zero       = format.wBitsPerSample == 8 ? (byte)128 : (byte)0;
     this.m_FillProc   = fillProc;
     global::WaveLib.WaveNative.Try(global::WaveLib.WaveNative.waveOutOpen(out this.m_WaveOut, device, format, this.m_BufferProc, 0, WaveNative.CALLBACK_FUNCTION));
     this.AllocateBuffers(bufferSize, bufferCount);
     this.m_Thread = new global::System.Threading.Thread(new global::System.Threading.ThreadStart(this.ThreadProc));
     this.m_Thread.Start();
 }
Exemple #6
0
        private void comboBox_Server_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.comboBox_Server.Text.ToString().Trim() != "0.0.0.0")
            {
                #region 設定IP、Port顯示
                this.NumericUpDown_Port.Value = this.MyServerList[this.comboBox_Server.SelectedIndex].ServerPort;
                if (this.MyServerList[this.comboBox_Server.SelectedIndex].IsMaster)
                {
                    this.checkBox_IsMaster.Checked = true;
                }
                else
                {
                    this.checkBox_IsMaster.Checked = false;
                }

                #endregion

                #region  測試是否可鏈接 Test connect click event procedure.
                // set result to default value ..
                resultVar = ConnectResult.NONE;
                // lock controls ..
                this.FormControls(false);

                // 獲取地址 analysis server address ..

                IPAddress[] ipadds = Dns.GetHostAddresses(this.comboBox_Server.Text.Trim());

                if (ipadds.Length > 0)
                {
                    // assign ip address ..
                    this.Addr = ipadds[0];

                    //創建新的線程鏈接伺服器 create therad object ..
                    __Connect = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(this.Connecting));

                    // start thread process and timer check ..
                    __Connect.Start(ipadds[0]);
                    __reply.Start();
                }
                else
                {
                    MessageBox.Show(this.ParseErrMsg, AssemblyInfoClass.ProductInfo, MessageBoxButtons.OK, MessageBoxIcon.Error);

                    // unlock controls ..
                    this.FormControls(true);
                    return;
                }
            }
            else
            {
                MessageBox.Show("未指定的位址");
            }
            #endregion
        }
Exemple #7
0
        public static global::sys.thread._Thread.HaxeThread allocate(global::System.Threading.Thread native)
        {
            unchecked {
                                #line 82 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                global::sys.thread._Thread.HaxeThread.allocateCount++;
                                #line 92 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                global::sys.thread._Thread.HaxeThread hx   = new global::sys.thread._Thread.HaxeThread(((global::System.Threading.Thread)(native)));
                global::System.WeakReference          @ref = new global::System.WeakReference(hx);
                                #line 94 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                lock (global::sys.thread._Thread.HaxeThread.threads){
                                        #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    if (((global::sys.thread._Thread.HaxeThread.allocateCount % 100) == 0))
                    {
                                                #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                        object _g = ((object)(new global::haxe.iterators.MapKeyValueIterator(((global::haxe.IMap)(global::sys.thread._Thread.HaxeThread.threads)))));
                                                #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                        while (true)
                        {
                                                        #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                            if (!(global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(_g, "hasNext", 407283053, null))))
                            {
                                                                #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                                break;
                            }

                                                        #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                            object _g1 = ((object)(global::haxe.lang.Runtime.callField(_g, "next", 1224901875, null)));
                                                        #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                            int key = ((int)(global::haxe.lang.Runtime.getField_f(_g1, "key", 5343647, true)));
                                                        #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                            global::System.WeakReference ref1 = ((global::System.WeakReference)(global::haxe.lang.Runtime.getField(_g1, "value", 834174833, true)));
                                                        #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                            if (!(ref1.IsAlive))
                            {
                                                                #line 95 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                                global::sys.thread._Thread.HaxeThread.threads.@remove(((int)(key)));
                            }
                        }
                    }

                                        #line 96 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                    {
                                                #line 96 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                        int key1 = native.ManagedThreadId;
                                                #line 96 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                        global::sys.thread._Thread.HaxeThread.threads.@set(((int)(key1)), ((object)(@ref)));
                    }
                }
                ;
                                #line 98 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                return(hx);
            }
                        #line default
        }
Exemple #8
0
 public static global::sys.thread._Thread.HaxeThread create(global::haxe.lang.Function cb)
 {
                 #line 35 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     global::System.Threading.Thread native = new global::System.Threading.Thread(((global::System.Threading.ThreadStart)(new global::sys.thread._Thread.Thread_Impl__create_35__Fun(cb).Delegate)));
     native.IsBackground = ((bool)(true));
                 #line 37 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     global::sys.thread._Thread.HaxeThread hx = global::sys.thread._Thread.HaxeThread.allocate(native);
     native.Start();
                 #line 40 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     global::sys.thread._Thread.HaxeThread this1 = hx;
                 #line 40 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     return((global::sys.thread._Thread.HaxeThread)(this1));
 }
Exemple #9
0
 public Listener(int newport, global::SIPLib.DelRequest d1, string name, global::SIPLib.DelCloseSession d2, global::SIPLib.Del OUT, global::SIPLib.DelStopListener DelSL)
 {
     global::SIPLib.Listener.DelRequest1      = d1;
     global::SIPLib.Listener.DelClosesession  = d2;
     global::SIPLib.Listener.DelOutput        = OUT;
     global::SIPLib.Listener.DelClosesession += CloseSession;
     global::SIPLib.Listener.Delstoplistener  = DelSL;
     global::SIPLib.Listener.StopFlag         = false;
     global::SIPLib.Listener.myName           = name;
     this.myIP = global::System.Net.Dns.GetHostEntry(host).AddressList[0];
     global::SIPLib.Listener.port = newport;
     this.ThreadListen            = new global::System.Threading.Thread(global::SIPLib.Listener.ListenSockets);
     this.ThreadListen.Start();
 }
Exemple #10
0
 public WaveInRecorder(int device, global::WaveLib.WaveFormat format, int bufferSize, int bufferCount, global::WaveLib.BufferEventHandler doneProc)
 {
     this.m_BufferProc = new global::WaveLib.WaveNative.WaveDelegate(global::WaveLib.WaveNative.WaveInBuffer.WaveInProc);
     this.m_DoneProc   = doneProc;
     global::WaveLib.WaveNative.Try(global::WaveLib.WaveNative.waveInOpen(out this.m_WaveIn, device, format, this.m_BufferProc, 0, global::WaveLib.WaveNative.CALLBACK_FUNCTION));
     this.AllocateBuffers(bufferSize, bufferCount);
     for (int i = 0; i < bufferCount; i++)
     {
         this.SelectNextBuffer();
         this.m_CurrentBuffer.Record();
     }
     global::WaveLib.WaveNative.Try(global::WaveLib.WaveNative.waveInStart(this.m_WaveIn));
     this.m_Thread = new global::System.Threading.Thread(new global::System.Threading.ThreadStart(this.ThreadProc));
     this.m_Thread.Start();
 }
Exemple #11
0
        public void Invite()
        {
            string Request = "INVITE sip: " + this.ToUser + "@" + this.ToIP + " SIP/2.0 " + "\n";

            Request += "Record-Route: <sip:" + this.ToUser + "@" + this.myIP.ToString() + ";lr>" + "\n";
            Request += "From: " + "\"" + this.MyName + "\"" + "<sip: " + this.MyName + "@" + this.myIP.ToString() + "> " + "\n";
            Request += "To: " + "<sip: " + this.ToUser + "@" + this.ToIP + "> " + "\n";
            Request += "Call-ID: " + this.SessionID + "@" + this.myIP + "\n";
            Request += "CSeq: " + (this.n).ToString() + " INVITE" + "\n";
            Request += "Date: " + global::System.DateTime.Now.ToString() + "\n";
            Request += "Allow: INVITE, ACK, CANCEL, BYE" + "\n";
            Request += this._SDP;
            this.SendInfo(Request);
            this.WaitForAnswer = new global::System.Threading.Thread(this.WaitForAnswerFunc);
            this.WaitForAnswer.Start();
        }
Exemple #12
0
        public static global::sys.thread._Thread.HaxeThread @get(global::System.Threading.Thread native)
        {
                        #line 69 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
            global::System.Threading.Thread native1 = global::System.Threading.Thread.CurrentThread;
            global::System.WeakReference    @ref    = null;
                        #line 71 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
            lock (global::sys.thread._Thread.HaxeThread.threads){
                                #line 72 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                int key = native1.ManagedThreadId;
                @ref = ((global::System.WeakReference)(global::sys.thread._Thread.HaxeThread.threads.@get(((int)(key)))));
            }
            ;
                        #line 75 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
            if (((@ref == null) || !(@ref.IsAlive)))
            {
                                #line 76 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
                return(global::sys.thread._Thread.HaxeThread.allocate(native1));
            }

                        #line 78 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
            return((global::sys.thread._Thread.HaxeThread)(@ref.Target));
        }
Exemple #13
0
 public ThreadWrap(ParameterizedThreadStart parameterizedThreadStart)
 {
     _thread = new global::System.Threading.Thread(parameterizedThreadStart);
 }
Exemple #14
0
 public Thread(global::System.Threading.Thread t)
 {
     this.t = t;
 }
Exemple #15
0
 protected static void __hx_ctor_sys_thread__Thread_HaxeThread(global::sys.thread._Thread.HaxeThread __hx_this, global::System.Threading.Thread native)
 {
                 #line 66 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     __hx_this.messages = new global::sys.thread.Deque();
                 #line 102 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     {
                         #line 102 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
         __hx_this.native = native;
     }
 }
Exemple #16
0
 public HaxeThread(global::System.Threading.Thread native)
 {
                 #line 101 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx"
     global::sys.thread._Thread.HaxeThread.__hx_ctor_sys_thread__Thread_HaxeThread(this, native);
 }
Exemple #17
0
 public ThreadWrap(ParameterizedThreadStart start)
 {
     UnderlyingObject = new global::System.Threading.Thread(start);
 }
Exemple #18
0
 public ThreadWrap(ParameterizedThreadStart start, int maxStackSize)
 {
     UnderlyingObject = new global::System.Threading.Thread(start, maxStackSize);
 }
Exemple #19
0
 public ThreadWrap(Thread thread)
 {
     _thread = thread;
 }
Exemple #20
0
 public ThreadWrap(ThreadStart threadStart)
 {
     _thread = new global::System.Threading.Thread(threadStart);
 }
Exemple #21
0
public Thread()
{
    internalThread = new global::System.Threading.Thread(runImplInternal);
}
Exemple #22
0
 public static global::Java.Lang.StackTraceElement[] GetThreadStackTrace(global::System.Threading.Thread thread)                         /* MethodBuilder.Create */
 {
     return(default(global::Java.Lang.StackTraceElement[]));
 }