void startLocalTunnel(AgentTunnel agent, Tunnel tunnel, LaunchSession launchSession) throws TunnelException { try { Request req = buildLocalTunnel(tunnel, launchSession); /* Only require replies if not running on the protocol thread. This allows autostart * tunnels to work without blocking */ if (!agent.sendRequest(req, Thread.currentThread() != agent.getThread())) { throw new TunnelException(TunnelException.AGENT_REFUSED_LOCAL_TUNNEL, (Throwable) null); } } catch (IOException ioe) { throw new TunnelException(TunnelException.INTERNAL_ERROR, ioe); } }