Beispiel #1
0
        /// <summary>
        /// 发送线程
        /// </summary>
        private void JustServiceSendThread()
        {
            JustArgs    args    = null;
            JustAdapter adapter = this.mAdapter;

            while (true)
            {
                Queue <JustArgs> argsQueue = this.argsQueue;

                args = null;
                if (argsQueue.Count > 0)
                {
                    args = argsQueue.Dequeue();
                }

                if (args == null)
                {
                    mSendEvent.WaitOne();
                    continue;
                    //args = argsQueue.Dequeue();
                }

                adapter.mJustClientInterface.LowLevelSend(mAdapter, args);

                JustEventInterface JustEvent = adapter.mJustEventInterface;
                if (JustEvent != null)
                {
                    JustEvent.OnSendEvent(adapter, args);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 接收线程
        /// </summary>
        private void JustServiceRecvThread()
        {
            byte[]      buffer  = null;
            JustAdapter adapter = this.mAdapter;

            while (true)
            {
                buffer = adapter.mJustClientInterface.LowLevelRecv(mAdapter);

                JustEventInterface JustEvent = adapter.mJustEventInterface;
                if (JustEvent != null)
                {
                    JustEvent.OnRecvEvent(adapter, buffer);

                    //TODO:根据返回值,决定是否需要继续接收
                }
            }
        }
Beispiel #3
0
 public JustAdapter(JustClientInterface mJustClientInterface, JustEventInterface mJustEventInterface,
                    object TAG) : this(mJustClientInterface, mJustEventInterface)
 {
     this.TAG = TAG;
 }
Beispiel #4
0
 public JustAdapter(JustClientInterface mJustClientInterface, JustEventInterface mJustEventInterface)
 {
     this.mJustClientInterface = mJustClientInterface;
     this.mJustEventInterface  = mJustEventInterface;
     this.TAG = null;
 }
Beispiel #5
0
 public JustAdapter(JustClientInterface mJustClientInterface, JustEventInterface mJustEventInterface,
     object TAG)
     : this(mJustClientInterface, mJustEventInterface)
 {
     this.TAG = TAG;
 }
Beispiel #6
0
 public JustAdapter(JustClientInterface mJustClientInterface, JustEventInterface mJustEventInterface)
 {
     this.mJustClientInterface = mJustClientInterface;
     this.mJustEventInterface = mJustEventInterface;
     this.TAG = null;
 }