public void add_connection(RemoteHost sender, RemoteHost receiver, bool IsSync)
        {
            try
            {
                if (IsSync)
                {
                    this.receiver = receiver;
                    this.sender = sender;
                    if (this.List_dataconnection.Exists(serch_connection))
                    {
                        throw new Exception("接続が存在します");
                    }

                    this.debugwindow.DebugLog = "[DataConnectionServer]データシンクロ接続を追加します.送信側リモートポート:" + sender.remotePort.ToString() + "受信側リモートポート:" + receiver.remotePort.ToString();
                    this.List_dataconnection.Add(new MyDataConnectionSync(sender, receiver));
                }
                else
                {
                    this.receiver = receiver;
                    this.sender = sender;
                    if (this.List_dataconnection.Exists(serch_connection))
                    {
                        throw new Exception("接続が存在します");
                    }

                    this.debugwindow.DebugLog = "[DataConnectionServer]データ接続を追加します.送信側リモートポート:" + sender.remotePort.ToString() + "受信側リモートポート:" + receiver.remotePort.ToString();
                    this.List_dataconnection.Add(new MyDataConnection(sender, receiver));
                }
            }
            catch (Exception ex)
            {
                this.debugwindow.DebugLog = "[" + this.ToString() + "]" + ex.Message;
            }
        }
        public MyDataConnection(RemoteHost sender, RemoteHost receiver)
        {
            this.Sender = sender;
            this.Receiver = receiver;

            this.Sender.ConnectionHost = this.Receiver;
            this.Receiver.ConnectionHost = this.Sender;
            this.IsConnectSync = false;
        }
        public MyDataConnectionSync(RemoteHost sender, RemoteHost receiver)
            : base(sender,receiver)
        {
            if (this.RECEIVER == null) return;
            if (this.SENDER == null) return;

            this.Sender.DataReceived += Sender_DataReceived;
            this.Receiver.IsSyncSend = true;
            this.IsConnectSync = true;
        }
 public void delete_connection(RemoteHost sender,RemoteHost receiver)
 {
     try
     {
         this.debugwindow.DebugLog = "[DataConnectionServer]データ接続を削除します.送信側リモートポート:" + sender.remotePort.ToString() + "受信側リモートポート:" + receiver.remotePort.ToString();
         this.receiver = receiver;
         this.sender = sender;
         this.List_dataconnection.RemoveAll(serch_connection);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }