listener factory: Remove protocol type check
This commit is contained in:
parent
5e9d260409
commit
1efff92862
|
@ -50,12 +50,11 @@ namespace SparkleLib {
|
||||||
|
|
||||||
Uri announce_uri = new Uri (uri);
|
Uri announce_uri = new Uri (uri);
|
||||||
|
|
||||||
// We use only one listener per notification service to keep
|
// Use only one listener per notification service to keep
|
||||||
// the number of connections as low as possible
|
// the number of connections as low as possible
|
||||||
foreach (SparkleListenerBase listener in listeners) {
|
foreach (SparkleListenerBase listener in listeners) {
|
||||||
if (listener.Server.Equals (announce_uri)) {
|
if (listener.Server.Equals (announce_uri)) {
|
||||||
SparkleHelpers.DebugInfo ("ListenerFactory", "Refered to existing " + announce_uri.Scheme +
|
SparkleHelpers.DebugInfo ("ListenerFactory", "Refered to existing listener for " + announce_uri);
|
||||||
" listener for " + announce_uri);
|
|
||||||
|
|
||||||
// We already seem to have a listener for this server,
|
// We already seem to have a listener for this server,
|
||||||
// refer to the existing one instead
|
// refer to the existing one instead
|
||||||
|
@ -64,19 +63,8 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new listener with the appropriate
|
listeners.Add (new SparkleListenerTcp (announce_uri, folder_identifier));
|
||||||
// type if one doesn't exist yet for that server
|
SparkleHelpers.DebugInfo ("ListenerFactory", "Issued new listener for " + announce_uri);
|
||||||
switch (announce_uri.Scheme) {
|
|
||||||
case "tcp":
|
|
||||||
listeners.Add (new SparkleListenerTcp (announce_uri, folder_identifier));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
listeners.Add (new SparkleListenerTcp (announce_uri, folder_identifier));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("ListenerFactory", "Issued new " + announce_uri.Scheme +
|
|
||||||
" listener for " + announce_uri);
|
|
||||||
|
|
||||||
return (SparkleListenerBase) listeners [listeners.Count - 1];
|
return (SparkleListenerBase) listeners [listeners.Count - 1];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue