Skip to content

In Vizkit::ConnectionManager: Using port as key leads to duplicates #68

@vbargsten

Description

@vbargsten

The hash @on_data_listeners in Vizkit::ConnectionManager uses port as key. However, if the port is e.g. of type SubPortProxy, and if the user connects again to the same port (determined from type, task, and name), the port is added multiple times (and we get multiple listeners for the same data). Is this the intended behavior? When should we consider port to be equal?

I found that Orocos::PortBase has a definition

        # True if +self+ and +other+ represent the same port
        def ==(other)
            return false if !other.kind_of?(PortBase)
            other.task == self.task && other.name == self.name
        end

Would adding a similar function as e.g. SubPortProxy.eql? (hash uses key.eql?) be reasonable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions