Mono.Zeroconf

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 1  →  ?path2? @ 2
/trunk/src/Mono.Zeroconf.Providers.AvahiDBus/Mono.Zeroconf.Providers.AvahiDBus/RegisterService.cs
@@ -38,7 +38,10 @@
private IAvahiEntryGroup entry_group;
public event RegisterServiceEventHandler Response;
 
private string originalName;
private int retryNameModifier = 2;
 
public RegisterService ()
{
}
@@ -95,12 +98,20 @@
switch (state) {
case EntryGroupState.Collision:
if (!OnResponse (ErrorCode.Collision)) {
throw new ApplicationException ();
if (originalName == null)
originalName = Name;
 
Name = originalName + " (" + retryNameModifier + ")";
retryNameModifier++;
 
Console.WriteLine("ZeroConf had a name collision, trying: " + Name);
 
Register();
}
break;
case EntryGroupState.Failure:
if (!OnResponse (ErrorCode.Failure)) {
throw new ApplicationException ();
Console.WriteLine("Mono.ZeroConf failed to register name with AvahiDBus");
}
break;
case EntryGroupState.Established: