Server/Servers.cs
changeset 26 a6fb2b2f73b0
parent 22 cac466b1b6e6
child 29 c4e03315035c
     1.1 --- a/Server/Servers.cs	Thu Aug 14 09:30:14 2014 +0200
     1.2 +++ b/Server/Servers.cs	Thu Aug 14 09:57:44 2014 +0200
     1.3 @@ -49,19 +49,26 @@
     1.4          //
     1.5          public void Connect(string aClientName)
     1.6          {
     1.7 +            Disconnect(aClientName);
     1.8 +
     1.9 +            //Register our client and its callback interface
    1.10              IDisplayServiceCallback callback = OperationContext.Current.GetCallbackChannel<IDisplayServiceCallback>();
    1.11 -            //remove the old client if any
    1.12 -            if (Program.iMainForm.iClients.Keys.Contains(aClientName))
    1.13 -            {
    1.14 -                Program.iMainForm.iClients.Remove(aClientName);
    1.15 -            }
    1.16 -            //Register our client
    1.17              Program.iMainForm.iClients.Add(aClientName, callback);
    1.18  
    1.19              //For some reason MP still hangs on that one
    1.20              //callback.OnConnected();
    1.21          }
    1.22  
    1.23 +        ///
    1.24 +        public void Disconnect(string aClientName)
    1.25 +        {
    1.26 +            //remove the old client if any
    1.27 +            if (Program.iMainForm.iClients.Keys.Contains(aClientName))
    1.28 +            {
    1.29 +                Program.iMainForm.iClients.Remove(aClientName);
    1.30 +            }
    1.31 +        }
    1.32 +
    1.33  
    1.34      }
    1.35