Changeset 128:7bc08698d7b9 in finroc_plugins_tcp-java


Ignore:
Timestamp:
20.08.2019 07:59:48 (5 weeks ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Tags:
tip
Message:

Adapts to changes in finroc_core-java (URI authority handling updates)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • internal/RemotePart.java

    r127 r128  
    2323 
    2424import java.net.InetAddress; 
    25 import java.util.ArrayList; 
    2625import java.util.concurrent.atomic.AtomicInteger; 
    2726 
     
    6059        this.peerInfo = peerInfo; 
    6160        this.peerImplementation = peerImplementation; 
    62         addUriAuthorityAlternative(peerInfo.uuid.toString()); 
     61        addUriAuthorityAlternative(peerInfo.uuid.toString(), false); 
     62        addUriAuthorityAlternative("localhost:" + peerInfo.uuid.port, true); 
    6363        for (InetAddress address : peerInfo.addresses) { 
    6464            addUriAuthorityAlternative(address); 
     
    6868    void addUriAuthorityAlternative(InetAddress address) { 
    6969        if (!(address.isLoopbackAddress() || address.isLinkLocalAddress())) { 
    70             super.addUriAuthorityAlternative(address.getHostAddress() + ":" + this.peerInfo.uuid.port); 
     70            super.addUriAuthorityAlternative(address.getHostAddress() + ":" + this.peerInfo.uuid.port, false); 
    7171        } 
    7272    } 
     
    7979    @Override 
    8080    public void createNewModel() { 
    81         newModelNode = new org.finroc.core.remote.RemoteRuntime(peerInfo.toString(), peerInfo.uuid.toString(), getAdminInterface(), getPrimaryConnection().getReadBufferStream(), handleStampWidth); 
     81        newModelNode = new org.finroc.core.remote.RemoteRuntime(peerInfo.toString(), peerInfo.uuid.toString(), getAdminInterface(), getPrimaryConnection().getReadBufferStream(), handleStampWidth, this); 
    8282        newModelNode.setFlags(RuntimeEnvironment.getInstance().getAllFlags()); 
    8383    } 
     
    108108 
    109109    @Override 
    110     public ArrayList<String> getUriAuthorityAlternatives(boolean sameHost) { 
    111         ArrayList<String> result = super.getUriAuthorityAlternatives(sameHost); 
    112         if (sameHost) { 
    113             result.add("localhost:" + peerInfo.uuid.port); 
    114         } 
    115         return result; 
    116     } 
    117  
    118     @Override 
    119110    public void processMessage(TCP.OpCode opCode, BinaryInputStream stream, Connection connection, BufferedModelChanges modelChanges) throws Exception { 
    120111        if (opCode == TCP.OpCode.PEER_INFO) { 
     
    142133    @Override 
    143134    public boolean hasSameHost(RemoteRuntime other) { 
    144         return this == other || ((other instanceof RemotePart) && this.peerInfo.uuid.hostName == ((RemotePart)other).peerInfo.uuid.hostName); 
     135        return this == other || ((other instanceof RemotePart) && this.peerInfo.uuid.hostName.equals(((RemotePart)other).peerInfo.uuid.hostName)); 
    145136    } 
    146137} 
Note: See TracChangeset for help on using the changeset viewer.