'Tests if addr and port correspond to self.Address() / self.Port().'

def Matches(self, addr, port):

    if isinstance(addr, list):
        if (self.Address() not in addr):
            return False
    else:
        myip = utils.ResolveHostnameToIP(self.Address(), self.Port())
        other_ip = utils.ResolveHostnameToIP(addr, port)
        if (ipaddr.IPAddress(myip) != ipaddr.IPAddress(other_ip)):
            return False
    return (self.Port() == port)
