def __init__(self, host, prog, vers, port=None): if port is None: pmap = rpc.TCPPortMapperClient(host) port = pmap.Getport((prog, vers, rpc.IPPROTO_TCP, 0)) pmap.close() if port == 0: raise RuntimeError, 'program not registered' rpc.RawTCPClient.__init__(self, host, prog, vers, port)
def __init__(self, host): self.packer = Vxi11Packer() self.unpacker = Vxi11Unpacker('') pmap = rpc.TCPPortMapperClient(host) mapping = (DEVICE_CORE_PROG, DEVICE_CORE_VERS, rpc.IPPROTO_TCP, 0) port = pmap.get_port(mapping) pmap.close() log.debug('VXI-11 uses port %d', port) rpc.RawTCPClient.__init__(self, host, DEVICE_CORE_PROG, DEVICE_CORE_VERS, port)