Home | History | Annotate | Download | only in android

Lines Matching refs:port

17 # The net test server is started from port 10201.
20 # A file to record next valid port of test server.
25 # The following two methods are used to allocate the port source for various
27 # same time, it's important to have a mechanism to allocate the port
28 # process-safe. In here, we implement the safe port allocation by leveraging
31 """Resets the port allocation to start from TEST_SERVER_PORT_FIRST.
41 logger.exception('Error while resetting port allocation')
46 """Allocates a port incrementally.
49 Returns a valid port which should be in between TEST_SERVER_PORT_FIRST and
50 TEST_SERVER_PORT_LAST. Returning 0 means no more valid port can be used.
52 port = 0
57 # Get current valid port and calculate next valid port.
61 port = int(fp.read())
62 ports_tried.append(port)
63 while not IsHostPortAvailable(port):
64 port += 1
65 ports_tried.append(port)
66 if (port > _TEST_SERVER_PORT_LAST or
67 port < _TEST_SERVER_PORT_FIRST):
68 port = 0
71 fp.write('%d' % (port + 1))
73 logger.exception('Error while allocating port')
78 if port:
79 logger.info('Allocate port %d for test server.', port)
81 logger.error('Could not allocate port for test server. '
83 return port
87 """Checks whether the specified host port is available.
90 host_port: Port on host to check.
93 True if the port on host is available, otherwise returns False.
106 """Checks whether the specified device port is used or not.
110 device_port: Port on device we want to check.
115 True if the port on device is already used, otherwise returns False.
134 def IsHttpServerConnectable(host, port, tries=3, command='GET', path='/',
140 port: Port number of the HTTP server.
161 host, port, timeout=timeout)) as http: