Lines Matching refs:port
107 # clear reverse port first Example: 'tcp:8011 tcp:9963' [Reverse]
124 def is_port_idle(host: str = "127.0.0.1", port: int = None) -> bool:
131 s.connect((host, port))
141 def get_forward_port(self, host: str = None, port: int = None, filter_ports: list = None):
147 port = 9999 - secrets.randbelow(99)
149 while cnt < 10 and port > 1024:
150 if port not in filter_ports and port not in ports_list and is_port_idle(host, port):
154 port -= 1
155 return port
276 def check_port_state(port: int = None) -> None:
279 log.debug("##########port state##########")
282 cmd = "lsof -i:{}".format(port)
286 out = shell_command("netstat -aon", "findstr :{}".format(port))
296 log.debug("##########port state##########")
298 log.error("check port state error, reason: {}".format(e))