예제 #1
0
        /// <summary>
        /// Waits for incoming messages on this connection
        /// </summary>
        public void Execute()
        {
            this.m_state = BackgroundServiceState.Running;
            this.listening = true;

            while (this.State == BackgroundServiceState.Running)
            {
                byte[] buffer = null;
                this.Connection.Receive(buffer);
            }

            this.listening = false;
        }
예제 #2
0
 private void Init()
 {
     this.m_state = BackgroundServiceState.Idle;
 }
예제 #3
0
 /// <summary>
 /// Get's called by Server to stop this thread
 /// </summary>
 public void Stop()
 {
     this.m_state = BackgroundServiceState.Idle;
 }
        private void OnGetBackgroundServiceState(object obj)
        {
            var msg = new BackgroundServiceState(BackgroundService != null && BackgroundService.IsStarted);

            _messagingCenter.Send <object, BackgroundServiceState>(this, FromBackgroundMessages.BackgroundServiceState, msg);
        }
 private void HandleStop()
 {
     this.m_state = BackgroundServiceState.Idle;
 }
 private void HandleStart(string[] args)
 {
     this.m_state = BackgroundServiceState.Running;
 }