Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-11-20 12:45:21 +0000
committerUwe Stieber2014-11-20 12:45:21 +0000
commita8a4a0390422950bdaa6ec94508c4c034657c5d8 (patch)
tree0b11a57d5f216c390e55c7b96fdc2169243db19c /target_explorer
parentccf4486ca1ae034508226605517d59ee29c921a8 (diff)
downloadorg.eclipse.tcf-a8a4a0390422950bdaa6ec94508c4c034657c5d8.tar.gz
org.eclipse.tcf-a8a4a0390422950bdaa6ec94508c4c034657c5d8.tar.xz
org.eclipse.tcf-a8a4a0390422950bdaa6ec94508c4c034657c5d8.zip
Target Explorer: Fix bugzilla 452466: Running multiple agents on localhost
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
index c1e007cfd..91dba9c1c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
@@ -6,6 +6,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Michael Jahn - [452466] Running multiple agents on localhost
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.nodes;
@@ -238,8 +239,9 @@ public class LocatorModel extends PlatformObject implements ILocatorModel {
String loopback = IPAddressUtil.getInstance().getIPv4LoopbackAddress();
// Get the canonical address
String canonical = IPAddressUtil.getInstance().getIPv4CanonicalAddress();
- // Get the peer IP
+ // Get the peer IP and port
String peerIP = peer.getAttributes().get(IPeer.ATTR_IP_HOST);
+ String peerPort = peer.getAttributes().get(IPeer.ATTR_IP_PORT);
// If the new peer IP is not a local host address, we are done checking
if (!IPAddressUtil.getInstance().isLocalHost(peerIP)) return result;
@@ -254,9 +256,11 @@ public class LocatorModel extends PlatformObject implements ILocatorModel {
if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(candidate.getTransportName()) || ITransportTypes.TRANSPORT_TYPE_SSL.equals(candidate.getTransportName())) {
String ip = candidate.getAttributes().get(IPeer.ATTR_IP_HOST);
Assert.isNotNull(ip);
+ String port = candidate.getAttributes().get(IPeer.ATTR_IP_PORT);
+ Assert.isNotNull(port);
// If the IP is for localhost, we have to do additional checking
- if (IPAddressUtil.getInstance().isLocalHost(ip)) {
+ if (IPAddressUtil.getInstance().isLocalHost(ip) && port.equals(peerPort)) {
// If the IP of the peer already in the model is the loopback address,
// ignore all other.
if (ip.equals(loopback)) { result = null; break; }

Back to the top