Changeset 156

Show
Ignore:
Timestamp:
03/08/07 19:26:44 (2 years ago)
Author:
kbarnes3
Message:

Added checks to ensure servers are added twice and fixed a bug that probably broke things before.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmp/trunk/Bridge/Bridge.cs

    r152 r156  
    101101                /// bridge's dictionary of clients or -1 if the connect fails</returns> 
    102102                public int AddServerConnection(Service theService) { 
     103                        if (this.serverNameToIdList.ContainsKey(theService.Name)) { // Already connected 
     104                                return -1; 
     105                        } 
    103106                        try { 
    104107                                Client newClient = new Client(theService); 
     
    117120                /// bridge's dictionary of clients or -1 if the connect fails</returns> 
    118121                public int AddServerConnection(string zeroconfName) { 
     122                        if (this.serverNameToIdList.ContainsKey(zeroconfName)) { // Already connected 
     123                                return -1; 
     124                        } 
    119125                        Dictionary<string, Service> serverList = this.getZeroconfServerList(); 
    120126                        if (serverList.ContainsKey(zeroconfName)) { 
     
    278284 
    279285 
    280                                 if (this.serverNameToIdList != null) { 
     286                                if (this.ServerAdded != null) { 
    281287                                        this.ServerAdded(this, new ServerStatusEventArgs(newClient.Name, true)); 
    282288                                }