original_docstring: Wait until server is listening on port
docstring: Wait until server is listening on port
docstring_tokens: Wait until server is listening on port
code: def wait_listening(client, server, port):
    "Wait until server is listening on port"
    if not 'telnet' in client.cmd('which telnet'):
      raise Exception('Could not find telnet')
    cmd = ('sh -c "echo A | telnet -e A %s %s"' %
           (server.IP(), port))
    while 'Connected' not in client.cmd(cmd):
      output('waiting for', server,
             'to listen on port', port, '\n')
      sleep(.5)
code_tokens: def wait_listening ( client , server , port ) : if not 'telnet' in client . cmd ( 'which telnet' ) : raise Exception ( 'Could not find telnet' ) cmd = ( 'sh -c "echo A | telnet -e A %s %s"' % ( server . IP ( ) , port ) ) while 'Connected' not in client . cmd ( cmd ) : output ( 'waiting for' , server , 'to listen on port' , port , '\n' ) sleep ( .5 )
short_docstring: Wait until server is listening on port
short_docstring_tokens: Wait until server is listening on port
comment: "Wait until server is listening on port"