Пример #1
0
 public virtual void OnSocStatusChangedOnInfo(SocStatusEventArgs e)
 {
     if (Logger.level >= LOGLEVEL.INFO)
     {
         OnSocStatusChanged(e);
     }
 }
Пример #2
0
 public virtual void OnSocStatusChangedOnDebug(SocStatusEventArgs e)
 {
     if (Logger.level >= LOGLEVEL.DEBUG)
     {
         OnSocStatusChanged(e);
     }
 }
Пример #3
0
 public virtual void OnSocStatusChangedOnError(SocStatusEventArgs e)
 {
     if (Logger.level >= LOGLEVEL.ERROR)
     {
         OnSocStatusChanged(e);
     }
 }
Пример #4
0
 protected override void ServerMgrStatusChanged(object sender, SocStatusEventArgs e)
 {
     if (e.Status.Cmd == MsgDef.MSG_BYE)
     {
         Stop();
     }
     base.OnSocStatusChanged(e);
 }
Пример #5
0
 protected override void ServerMgrStatusChanged(object sender, SocStatusEventArgs e)
 {
     if (e.Status.Cmd == MsgDef.MSG_BYE)
     {
         Stop();
     }
     base.OnSocStatusChanged(e);
 }
Пример #6
0
 protected void FTP_StatusChanged(object sender, SocStatusEventArgs e)
 {
     //if (e.Status.Cmd == MsgDef.MSG_BYE)
     //{
     //   server.
     //}
     base.OnSocStatusChanged(e);
 }
Пример #7
0
        public virtual void OnSocStatusChanged(SocStatusEventArgs e)
        {
            EventHandler<SocStatusEventArgs> handler = SocStatusChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #8
0
        public virtual void OnSocStatusChanged(SocStatusEventArgs e)
        {
            EventHandler <SocStatusEventArgs> handler = SocStatusChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #9
0
        public virtual void OnSocStatusChanged(SocStatusEventArgs e)
        {
            EventHandler <SocStatusEventArgs> handler = SocStatusChanged;

            if (handler != null)
            {
                //Logger.WriteLine("ServerManager.OnSocStatusChanged");

                handler(this, e);
            }
        }
Пример #10
0
 public override void OnSocStatusChanged(SocStatusEventArgs e)
 {
     if (e.Status.status == SocHandlerStatus.CONNECTED
         || e.Status.status == SocHandlerStatus.DISCONNECTED)
     {
         Initialize();
     }
     if (e.Status.status == SocHandlerStatus.ERROR)
     {
         if (!closedOnError)
         {
             closedOnError = true;
             closeFTPConnection(e.Status);
         }
     }
     base.OnSocStatusChanged(e);
 }
Пример #11
0
 public override void OnSocStatusChanged(SocStatusEventArgs e)
 {
     if (e.Status.status == SocHandlerStatus.CONNECTED ||
         e.Status.status == SocHandlerStatus.DISCONNECTED)
     {
         Initialize();
     }
     if (e.Status.status == SocHandlerStatus.ERROR)
     {
         if (!closedOnError)
         {
             closedOnError = true;
             closeFTPConnection(e.Status);
         }
     }
     base.OnSocStatusChanged(e);
 }
Пример #12
0
        private void UpdateButtonSendingText(object sender, SocStatusEventArgs e)
        {
            if (this.ButtonFileSend.InvokeRequired)
            {
                SetThreadSocMsgButtonCallback d = new SetThreadSocMsgButtonCallback(UpdateButtonSendingText);
                this.Invoke(d, new object[] { sender, e });
            }
            else
            {
                ButtonFileSend.Text = "��������";
                mIsSending = false;

                FTP_END();
            }
        }
Пример #13
0
        private void SocStatusChanged(object sender, SocStatusEventArgs e)
        {
            UpdateMsgStatus(sender, e);

            if (e.Status.status == SocHandlerStatus.FTP_SENDING)
            {
                UpdateFTPStatus(sender, e);
            }
            else if (e.Status.status == SocHandlerStatus.FTP_END
                || e.Status.status == SocHandlerStatus.FTP_CANCELED
                || e.Status.status == SocHandlerStatus.FTP_SERVER_CANCELED)
            {
                UpdateButtonSendingText(sender, e);
            }

            AppendConsoleMsg(sender, e, "");
        }
Пример #14
0
        private void AppendConsoleMsg(object sender, SocStatusEventArgs e, string msg)
        {
            if (this.RichTextBoxLog.InvokeRequired)
            {
                SetThreadSocMsgConsoleCallback d = new SetThreadSocMsgConsoleCallback(AppendConsoleMsg);
                this.Invoke(d, new object[] { sender, e, msg });
            }
            else
            {
                if (e.Status.socMessage != null && e.Status.socMessage.Trim() != "")
                    RichTextBoxLog.AppendText(">" + e.Status.socMessage + "\n");
                if (msg != null && msg.Trim() != "")
                    RichTextBoxLog.AppendText(">" + msg + "\n");

                if (e.Status.exception != null)
                {
                    if (e.Status.exception is SocketException)
                        RichTextBoxLog.AppendText(string.Format(">Error: {0} : {1}",
                            ((SocketException)e.Status.exception).ErrorCode,
                            ((SocketException)e.Status.exception).Message));
                    else
                        RichTextBoxLog.AppendText(string.Format(">Error: {0}", e.Status.exception.Message));
                }
                RichTextBoxLog.ScrollToCaret();
            }
        }
Пример #15
0
        private void FTP_SndStatusChanged(object sender, SocStatusEventArgs e)
        {
            try
            {
                StateObject stateObject = e.Status;
                if (FileSendFormList.Count != 0 && FileSendFormList[stateObject.key] != null)
                {
                    SendFileForm sendFileForm = (SendFileForm)FileSendFormList[stateObject.key];
                    FileSendDetailListView fileSendDetailList = (FileSendDetailListView)FileSendDetailList[stateObject.key];
                    logWrite("CHOI_DEBUG e.Status.status == SocHandlerStatus.ERROR");
                    switch (e.Status.status) 
                    {
                        case SocHandlerStatus.FTP_SENDING:
                            int transRate = (int)(stateObject.fileSizeDone * (long)100 / stateObject.FileSize);

                            logWrite("전송중(" + transRate + " %)");
                            Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.SENDING, "전송중(" + transRate + " %)", transRate, sendFileForm });
                            Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송중(" + transRate + " %)", fileSendDetailList });
                            break;
                        case SocHandlerStatus.FTP_END:
                            logWrite("파일전송완료");
                            Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.SUCCESS, "전송완료", -1, sendFileForm });
                            Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송완료", fileSendDetailList });
                            break;
                        case SocHandlerStatus.FTP_SERVER_CANCELED:
                        case SocHandlerStatus.FTP_CANCELED:
                            logWrite("파일전송취소");
                            Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.CANCELED, "전송취소", -1, sendFileForm });
                            Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송취소", fileSendDetailList });
                            break;
                        case SocHandlerStatus.ERROR:
                            logWrite("파일전송실패");
                            Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.FAILED, "전송실패", -1, sendFileForm });
                            Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송실패", fileSendDetailList });
                            break;
                    }

                }
                else
                {
                    logWrite(string.Format("에러 : FileSendFormList" + "해당화면없음."));
                }
            }
            catch (Exception ex)
            {
                logWrite(ex.ToString());
            }
            //AppendConsoleMsg(sender, e, "");


            //sendfilesize = (sendfilesize - 40960.0);
            //total += percent;
            //if (total >= 100.0) total = 100.0;
            //string[] totalArray = (total.ToString()).Split('.');

            //if (!iep.Address.ToString().Equals(serverIP))
            //{
            //    if (FileSendFormList.Count != 0 && FileSendFormList[formKey] != null)
            //    {
            //        Invoke(showFileSendStatDelegate, new object[] { "전송중(" + totalArray[0] + " %)", form });
            //    }
            //    if (FileSendDetailList.Count != 0 && FileSendDetailList[formKey] != null)
            //    {
            //        string detailmsg = "전송중(" + totalArray[0] + " %)";
            //        Invoke(showFileSendDetailDelegate, new object[] { rcvId, detailmsg, view });
            //    }
            //}

        }
Пример #16
0
 private void RichTextBoxLogChanged(object sender, SocStatusEventArgs e, string strStatus)
 {
     if (this.RichTextBoxLog.InvokeRequired)
     {
         CallbackRichTextBoxLog d = new CallbackRichTextBoxLog(RichTextBoxLogChanged);
         this.Invoke(d, new object[] { sender, e, strStatus });
     }
     else
     {
         this.RichTextBoxLog.AppendText(">" + strStatus + ":" + e.Status.socMessage + "\n");
         if (e.Status.exception != null)
         {
             if (e.Status.exception is SocketException)
                 RichTextBoxLog.AppendText(string.Format(">Error: {0} : {1}",
                     ((SocketException)e.Status.exception).ErrorCode,
                     ((SocketException)e.Status.exception).Message) + "\n");
             else
             {
                 this.RichTextBoxLog.AppendText(string.Format(">Error: {0}", e.Status.exception.Message) + "\n");
             }
         }
         this.RichTextBoxLog.ScrollToCaret();
     }
 }
Пример #17
0
 protected override void TcpClientStatusChanged(object sender, SocStatusEventArgs e)
 {
     base.OnSocStatusChanged(e);
 }
Пример #18
0
 private void ProgressBarFileEnd(object sender, SocStatusEventArgs e)
 {
     if (this.ProgressBarFileReceiving.InvokeRequired)
     {
         CallbackProgressBarFileEnd d = new CallbackProgressBarFileEnd(ProgressBarFileEnd);
         this.Invoke(d, new object[] { sender, e });
     }
     else
     {
         this.ProgressBarFileReceiving.Visible = false;
         Logger.info("ProgressBarFileReceiving.Visible=" + ProgressBarFileReceiving.Visible);
     }
 }
Пример #19
0
 protected virtual void TcpClientStatusChanged(object sender, SocStatusEventArgs e)
 {
     OnSocStatusChanged(e);
 }
Пример #20
0
 public virtual void OnSocStatusChangedOnInfo(SocStatusEventArgs e)
 {
     if (Logger.level >= LOGLEVEL.INFO)
         OnSocStatusChanged(e);
 }
Пример #21
0
 public virtual void OnSocStatusChangedOnError(SocStatusEventArgs e)
 {
     if (Logger.level >= LOGLEVEL.ERROR)
         OnSocStatusChanged(e);
 }
Пример #22
0
 public virtual void OnSocStatusChangedOnDebug(SocStatusEventArgs e)
 {
     if (Logger.level >= LOGLEVEL.DEBUG)
         OnSocStatusChanged(e);
 }
Пример #23
0
        private void SocStatusChanged(object sender, SocStatusEventArgs e)
        {
            //Logger.info("Form1.OnSocStatusChanged:"+e.Status.socMessage);

            string strStatus = "";
            switch (e.Status.status)
            {
                case SocHandlerStatus.UNINIT:
                    strStatus = "UNINIT";
                    break;
                case SocHandlerStatus.CONNECTED:
                    strStatus = "CONNECTED";
                    break;
                case SocHandlerStatus.DISCONNECTED:
                    strStatus = "DISCONNECTED";
                    break;
                case SocHandlerStatus.ERROR:
                    strStatus = "ERROR";
                    break;
                case SocHandlerStatus.RECEIVING:
                    strStatus = "RECEIVING";
                    break;
                case SocHandlerStatus.SENDING:
                    strStatus = "SENDING";
                    break;
                case SocHandlerStatus.LISTENING:
                    strStatus = "LISTENING";
                    break;
                case SocHandlerStatus.STOP:
                    strStatus = "STOP";
                    break;
            }

            if (e.Status.ftpStatus == FTPStatus.RECEIVE_STREAM)
            {
                ProgressBarStatusChanged(sender, e);
            }

            if (e.Status.ftpStatus == FTPStatus.RECEIVED_FILE_INFO)
            {
                ProgressBarFileBegin(sender, e);
                ButtonCancelStatusChanged(sender, e);
            }
            if (e.Status.ftpStatus == FTPStatus.SENT_DONE)
            {
                ProgressBarFileEnd(sender, e);
                ButtonCancelStatusChanged(sender, e);
            }

            RichTextBoxLogChanged(sender, e, strStatus);

            TextBoxSocketStatusChanged(sender, e, strStatus);
        }
Пример #24
0
 protected virtual void TcpClientStatusChanged(object sender, SocStatusEventArgs e)
 {
     OnSocStatusChanged(e);
 }
Пример #25
0
 private void UpdateFTPStatus(object sender, SocStatusEventArgs e)
 {
     if (this.ProgressBarFileReceiving.InvokeRequired)
     {
         SetThreadSocMsgCallback d = new SetThreadSocMsgCallback(UpdateFTPStatus);
         this.Invoke(d, new object[] { sender, e });
     }
     else
     {
         mCurTransferSize += e.Status.bufferSize;
         ProgressBarFileReceiving.Value = (int)(mCurTransferSize * (long)100 / mFileSize);
     }
 }
Пример #26
0
 private void UpdateMsgStatus(object sender, SocStatusEventArgs e)
 {
     if (this.TextBoxSocketStatus.InvokeRequired)
     {
         SetThreadSocMsgLabelCallback d = new SetThreadSocMsgLabelCallback(UpdateMsgStatus);
         this.Invoke(d, new object[] { sender, e });
     }
     else
     {
         string strStatus = "";
         switch (e.Status.status)
         {
             case SocHandlerStatus.UNINIT:
                 strStatus = "UNINIT";
                 break;
             case SocHandlerStatus.CONNECTED:
                 strStatus = "CONNECTED";
                 break;
             case SocHandlerStatus.DISCONNECTED:
                 strStatus = "DISCONNECTED";
                 break;
             case SocHandlerStatus.ERROR:
                 strStatus = "ERROR";
                 break;
             case SocHandlerStatus.RECEIVING:
                 strStatus = "RECEIVING";
                 break;
             case SocHandlerStatus.SENDING:
                 strStatus = "SENDING";
                 break;
         }
         AddEventsLogMessage(strStatus);
     }
 }
Пример #27
0
 protected override void TcpClientStatusChanged(object sender, SocStatusEventArgs e)
 {
     base.OnSocStatusChanged(e);
 }
Пример #28
0
 protected virtual void ServerMgrStatusChanged(object sender, SocStatusEventArgs e)
 {
     OnSocStatusChanged(e);
 }
Пример #29
0
 private void TextBoxSocketStatusChanged(object sender, SocStatusEventArgs e, string strStatus)
 {
     if (this.TextBoxSocketStatus.InvokeRequired)
     {
         CallbackTextBoxSocketStatus d = new CallbackTextBoxSocketStatus(TextBoxSocketStatusChanged);
         this.Invoke(d, new object[] { sender, e, strStatus });
     }
     else
     {
         AddEventsLogMessage(strStatus);
         //UpdateListBoxSelectedItemIndicesTextBox();
     }
 }
Пример #30
0
 private void ButtonCancelStatusChanged(object sender, SocStatusEventArgs e)
 {
     if (this.ButtonStopReceiving.InvokeRequired)
     {
         CallbackCancelButtonStatus d = new CallbackCancelButtonStatus(ButtonCancelStatusChanged);
         this.Invoke(d, new object[] { sender, e });
     }
     else
     {
         //ButtonStopReceiving.Enabled = !ButtonStopReceiving.Enabled;
     }
 }
Пример #31
0
 protected virtual void ServerMgrStatusChanged(object sender, SocStatusEventArgs e)
 {
     OnSocStatusChanged(e);
 }
Пример #32
0
        public virtual void OnSocStatusChanged(SocStatusEventArgs e)
        {
            EventHandler<SocStatusEventArgs> handler = SocStatusChanged;

            if (handler != null)
            {
                //Logger.WriteLine("ServerManager.OnSocStatusChanged");

                handler(this, e);

            }
        }
Пример #33
0
        public void FTP_RcvStatusChanged(object sender, SocStatusEventArgs e)
        {
            if (e.Status.Cmd == MsgDef.MSG_BYE)
            {
                FTP_Stop();
            }
            if (e.Status.status == SocHandlerStatus.ERROR)
            {
                logWrite("CHOI_DEBUG e.Status.status == SocHandlerStatus.ERROR");

                FTP_InvokeDownloadForm(DownloadStatus.FAILED, -1, mFormKeyRcv);
            }
            else
            {
                switch (e.Status.ftpStatus)
                {
                    case FTPStatus.RECEIVE_STREAM://진행
                        FTP_InvokeDownloadForm(DownloadStatus.RECEIVING, (int)(100 * e.Status.fileSizeDone / e.Status.FileSize), mFormKeyRcv);
                        break;
                    case FTPStatus.RECEIVED_FILE_INFO://시작
                        FTP_InvokeDownloadForm(DownloadStatus.START, -1, mFormKeyRcv);
                        break;
                    case FTPStatus.SENT_DONE://종료
                        FTP_InvokeDownloadForm(DownloadStatus.END, -1, mFormKeyRcv);
                        break;
                }
            }
        }
Пример #34
0
 protected void FTP_StatusChanged(object sender, SocStatusEventArgs e)
 {
     //if (e.Status.Cmd == MsgDef.MSG_BYE)
     //{
     //   server.
     //}
     base.OnSocStatusChanged(e);
 }
Пример #35
0
 private void ProgressBarStatusChanged(object sender, SocStatusEventArgs e)
 {
     if (this.ProgressBarFileReceiving.InvokeRequired)
     {
         CallbackProgressBarFileStream d = new CallbackProgressBarFileStream(ProgressBarStatusChanged);
         this.Invoke(d, new object[] { sender, e });
     }
     else
     {
         this.ProgressBarFileReceiving.Value = (int)(100 * e.Status.fileSizeDone / e.Status.FileSize);
         Logger.info("ProgressBarFileReceiving.Value=" + ProgressBarFileReceiving.Value);
     }
 }