Exemplo n.º 1
0
 /// <summary>
 /// エラーが起こった際のアクション。
 /// </summary>
 /// <param name="e">イベント引数。</param>
 protected virtual void OnErrorOccurred(CommunicationErrorEventArgs e)
 {
     _ErrorFlag = true;
     if (ErrorOccurred != null)
     {
         ErrorOccurred(this, e);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// クライアントとの通信エラーが発生した際に実行されるイベントハンドラ。
        /// </summary>
        /// <param name="sender">イベント発生元。</param>
        /// <param name="e">イベント引数。</param>
        private void Client_ErrorOccurred(object sender, CommunicationErrorEventArgs e)
        {
            // 切断する
            TCPCommunication communication = (TCPCommunication)sender;

            CloseClient(communication);
            // イベントを発生させる
            OnClientDisconnected(new CommunicationEventArgs(communication));
        }