mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 18:35:32 +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">
|
<attribute name="multicast" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<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>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
package org.eclipse.tm.discovery.protocol;
|
package org.eclipse.tm.discovery.protocol;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -142,15 +144,21 @@ public class ProtocolFactory {
|
||||||
|
|
||||||
String[] pairs = multicastAddresses.split(";"); //$NON-NLS-1$
|
String[] pairs = multicastAddresses.split(";"); //$NON-NLS-1$
|
||||||
for (int j = 0; j < pairs.length; j++) {
|
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];
|
if(uri.getScheme().equals(transportName))
|
||||||
break;
|
{
|
||||||
|
multiCastAddress = uri.getSchemeSpecificPart();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return multiCastAddress;
|
return multiCastAddress;
|
||||||
|
|
|
@ -15,7 +15,7 @@ Contributors:
|
||||||
<extension point="org.eclipse.tm.discovery.engine.discoveryProtocol">
|
<extension point="org.eclipse.tm.discovery.engine.discoveryProtocol">
|
||||||
<protocol
|
<protocol
|
||||||
class="org.eclipse.tm.internal.discovery.protocol.dnssd.DNSSDProtocol"
|
class="org.eclipse.tm.internal.discovery.protocol.dnssd.DNSSDProtocol"
|
||||||
multicast="UDP#224.0.0.251"
|
multicast="UDP:224.0.0.251"
|
||||||
name="DNS-SD"/>
|
name="DNS-SD"/>
|
||||||
</extension>
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -133,6 +133,10 @@ public class ServiceDiscoveryWizardMainPage extends WizardPage {
|
||||||
tempAddress = addressText.getText();
|
tempAddress = addressText.getText();
|
||||||
addressText.setText(multicastAddress);
|
addressText.setText(multicastAddress);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
((Button)src).setSelection(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue