mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 15:15:25 +02:00
Multicast address using URI notation
This commit is contained in:
parent
72a0e2e522
commit
c64ccfc513
4 changed files with 22 additions and 8 deletions
|
@ -64,7 +64,9 @@
|
|||
<attribute name="multicast" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Allows specifying multicast addresses to be used with different transports in the format "transportName1#address1;transportName2#address2"
|
||||
Allows specifying semicolon separated multicast addresses to be used with specific transports in the format <transport>:<address>
|
||||
An example would be:
|
||||
<code>"transportName1:address1;transportName2:address2;UDP:224.0.0.251"<code/>
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
package org.eclipse.tm.discovery.protocol;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
@ -142,15 +144,21 @@ public class ProtocolFactory {
|
|||
|
||||
String[] pairs = multicastAddresses.split(";"); //$NON-NLS-1$
|
||||
for (int j = 0; j < pairs.length; j++) {
|
||||
String[] pair = pairs[j].split("#"); //$NON-NLS-1$
|
||||
if(pair[0].equals(transportName))
|
||||
|
||||
URI uri=null;
|
||||
try {
|
||||
uri = new URI(pairs[j]);
|
||||
} catch (URISyntaxException e) {}
|
||||
|
||||
if(uri!=null)
|
||||
{
|
||||
multiCastAddress = pair[1];
|
||||
break;
|
||||
if(uri.getScheme().equals(transportName))
|
||||
{
|
||||
multiCastAddress = uri.getSchemeSpecificPart();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return multiCastAddress;
|
||||
|
|
|
@ -15,7 +15,7 @@ Contributors:
|
|||
<extension point="org.eclipse.tm.discovery.engine.discoveryProtocol">
|
||||
<protocol
|
||||
class="org.eclipse.tm.internal.discovery.protocol.dnssd.DNSSDProtocol"
|
||||
multicast="UDP#224.0.0.251"
|
||||
multicast="UDP:224.0.0.251"
|
||||
name="DNS-SD"/>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -133,6 +133,10 @@ public class ServiceDiscoveryWizardMainPage extends WizardPage {
|
|||
tempAddress = addressText.getText();
|
||||
addressText.setText(multicastAddress);
|
||||
}
|
||||
else
|
||||
{
|
||||
((Button)src).setSelection(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue