def resolveHostName(_self, resolutionReceiver, hostName, portNumber=0, addressTypes=None, transportSemantics='TCP'):
    resolution = HostResolution(hostName)
    resolutionReceiver.resolutionBegan(resolution)
    if (hostName not in self.lookups):
        raise DNSLookupError('OH NO')
    resolutionReceiver.addressResolved(IPv4Address('TCP', self.lookups[hostName], portNumber))
    resolutionReceiver.resolutionComplete()
    return resolution
def resolveHostName(_self, resolutionReceiver, hostName, portNumber=0, addressTypes=None, transportSemantics='TCP'):
    resolution = HostResolution(hostName)
    resolutionReceiver.resolutionBegan(resolution)
    if (hostName not in self.lookups):
        raise DNSLookupError('OH NO')
    resolutionReceiver.addressResolved(IPv4Address('TCP', self.lookups[hostName], portNumber))
    resolutionReceiver.resolutionComplete()
    return resolution