Client/MainForm.cs
changeset 32 4c416d2878dd
parent 31 f19b04646b6a
child 33 1363bda20171
     1.1 --- a/Client/MainForm.cs	Fri Aug 15 11:11:17 2014 +0200
     1.2 +++ b/Client/MainForm.cs	Fri Aug 15 13:26:38 2014 +0200
     1.3 @@ -39,10 +39,11 @@
     1.4              iClient = new Client(instanceContext);
     1.5  
     1.6              //Connect using unique name
     1.7 -            string name = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff tt");
     1.8 -            iClient.Connect(name);
     1.9 +            //string name = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff tt");
    1.10 +            string name = "Client-" + (iClient.ClientCount() - 1);
    1.11 +            iClient.SetName(name);
    1.12              //Text = Text + ": " + name;
    1.13 -            Text = Text + ": " + iClient.SessionId;
    1.14 +            Text = "[[" + name + "]]  " + iClient.SessionId;
    1.15  
    1.16          }
    1.17  
    1.18 @@ -67,7 +68,6 @@
    1.19                  //We are in the proper thread
    1.20                  if (IsClientReady())
    1.21                  {
    1.22 -                    //iClient.Disconnect();
    1.23                      Trace.TraceInformation("Closing client: " + iClient.SessionId);
    1.24                      iClient.Close();
    1.25                      Trace.TraceInformation("Closed client: " + iClient.SessionId);
    1.26 @@ -99,11 +99,6 @@
    1.27  
    1.28          private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
    1.29          {
    1.30 -            if (IsClientReady()) //Could catch exception instead
    1.31 -            {
    1.32 -                iClient.Disconnect();
    1.33 -            }
    1.34 -
    1.35              CloseConnectionThreadSafe();
    1.36          }
    1.37