Ejemplo n.º 1
0
 private void DisconnectClientHostsByUserPort(ConnectionHostData.MainCommunication ReceiveData)
 {
     try
     {
         this.List_DataConnection.Find(this.SelectConnectionByUser).DisConnect();
         this.List_DataConnection.RemoveAll(this.SelectConnectionByUser);
     }
     catch (Exception ex)
     {
         Errorlog.Print(ex, this);
     }
 }
Ejemplo n.º 2
0
 private void ConnectClientHosts(ConnectionHostData.MainCommunication ReceiveData)
 {
     try
     {
         if (!(this.List_ClientHosts.Count >= ReceiveData.connection.SenderID && this.List_ClientHosts.Count >= ReceiveData.connection.ReceiverID))
         {
             Report.Print("Indecies are over flow.", this);
             return;
         }
         this.List_DataConnection.Add(new DataConnection(ReceiveData.connection.SenderID, ReceiveData.connection.ReceiverID, this.List_ClientHosts));
         this.List_DataConnection[this.List_DataConnection.Count - 1].Connect();
     }
     catch (Exception ex)
     {
         Errorlog.Print(ex, this);
     }
 }
Ejemplo n.º 3
0
 private void ConnectClientHostsByUserPort(ConnectionHostData.MainCommunication ReceiveData)
 {
     try
     {
         if (!(this.List_ClientHosts.Exists(IsSenderByUser) && this.List_ClientHosts.Exists(IsReceiverByUser))) return;
         this.List_DataConnection.Add(new DataConnection(this.List_ClientHosts.Find(IsSenderByUser), this.List_ClientHosts.Find(IsReceiverByUser)));
         this.List_DataConnection[this.List_DataConnection.Count - 1].Connect();
     }
     catch (Exception ex)
     {
         Errorlog.Print(ex, this);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// stop and remove client
        /// </summary>
        /// <param name="ReceiveData"></param>
        private void ClientHostDelete(ConnectionHostData.MainCommunication ReceiveData)
        {
            try
            {
                if (this.List_Port.Contains(ReceiveData.DeletePort))
                {
                    int id = this.List_Port.IndexOf(ReceiveData.DeletePort);

                    this.CheckAndDisconnectClientsConnection(id);

                    this.List_Port.RemoveAt(id);
                    this.List_ClientHosts[id].Close();
                    this.List_ClientHosts.RemoveAt(id);
                    Report.PrintDateBar(this);
                    Report.Print("Close Port : " + ReceiveData.DeletePort.ToString(), this);
                }
            }
            catch (Exception ex)
            {
                Errorlog.Print(ex, this);
            }
        }