'Returns the path of the persistent connection socket.
Attempts to ensure (within playcontext.timeout seconds) that the
socket path exists. If the path exists (or the timeout has expired),
returns the socket path.'

def run(self):

    (p, out, err) = self._do_it('RUN:')
    while True:
        out = out.strip()
        if (out == ''):
            return None
        elif out.startswith('#SOCKET_PATH#'):
            break
        else:
            out = p.stdout.readline()
    socket_path = out.split('#SOCKET_PATH#:    ', 1)[1]
    return to_text(socket_path, errors='surrogate_or_strict')
