Changeset 1081


Ignore:
Timestamp:
01/07/09 15:31:58 (12 years ago)
Author:
kgrading
Message:

login bugfixing for (#401)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Communication/WcfService.cs

    r1036 r1081  
    2828
    2929    public event EventHandler ConnectionRestored;   
    30     public event EventHandler ServerChanged;   
     30    public event EventHandler ServerChanged;
     31    public event EventHandler Connected;   
    3132
    3233    public ClientCommunicatorClient proxy = null;
     
    3738    public void Connect() {
    3839      try {
    39         proxy = null;
    40         if (proxy == null) {
    41           proxy = new ClientCommunicatorClient(
    42             new NetTcpBinding(),
    43             new EndpointAddress("net.tcp://" + ServerIP + ":" + ServerPort + "/HiveServer/ClientCommunicator")
    44             );
    45         }
     40        proxy = new ClientCommunicatorClient(
     41          new NetTcpBinding(),
     42          new EndpointAddress("net.tcp://" + ServerIP + ":" + ServerPort + "/HiveServer/ClientCommunicator")
     43        );
    4644
    4745        proxy.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(proxy_LoginCompleted);
     
    4947        proxy.SendJobResultCompleted += new EventHandler<SendJobResultCompletedEventArgs>(proxy_SendJobResultCompleted);
    5048        proxy.SendHeartBeatCompleted += new EventHandler<SendHeartBeatCompletedEventArgs>(proxy_SendHeartBeatCompleted);
    51 
     49        proxy.Open();       
     50        if (Connected != null)
     51          Connected(this, new EventArgs());           
    5252        if (ConnState == NetworkEnum.WcfConnState.Failed)
    5353          ConnectionRestored(this, new EventArgs());
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r1036 r1081  
    7272      wcfService.ConnectionRestored += new EventHandler(wcfService_ConnectionRestored);
    7373      wcfService.ServerChanged += new EventHandler(wcfService_ServerChanged);
    74 
     74      wcfService.Connected += new EventHandler(wcfService_Connected);
    7575      ConnectionContainer cc = ConfigManager.Instance.GetServerIPAndPort();
    7676      if (cc.IPAdress != String.Empty && cc.Port != 0) {
     
    189189
    190190    void wcfService_ServerChanged(object sender, EventArgs e) {
    191       foreach(KeyValuePair<long, AppDomain> entries in appDomains)
    192         AppDomain.Unload(appDomains[entries.Key]);
    193       appDomains = new Dictionary<long, AppDomain>();
    194       engines = new Dictionary<long, Executor>();
     191      lock (Locker) {
     192        foreach (KeyValuePair<long, AppDomain> entries in appDomains)
     193          AppDomain.Unload(appDomains[entries.Key]);
     194        appDomains = new Dictionary<long, AppDomain>();
     195        engines = new Dictionary<long, Executor>();
     196      }
     197    }
     198
     199    void wcfService_Connected(object sender, EventArgs e) {
    195200      wcfService.LoginAsync(ConfigManager.Instance.GetClientInfo());
    196201    }
Note: See TracChangeset for help on using the changeset viewer.