Home | History | Annotate | Download | only in android

Lines Matching refs:port

15 # The net test server is started from port 10201.
18 # A file to record next valid port of test server.
23 # The following two methods are used to allocate the port source for various
25 # same time, it's important to have a mechanism to allocate the port
26 # process-safe. In here, we implement the safe port allocation by leveraging
29 """Resets the port allocation to start from TEST_SERVER_PORT_FIRST.
41 logging.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 logging.exception('ERror while allocating port')
78 if port:
79 logging.info('Allocate port %d for test server.', port)
81 logging.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: