public String start() throws Exception { authSocket = AprLibrary.createLocalSocketAddress(); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.bind(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } AprLibrary.secureLocalSocket(authSocket, handle); result = Local.listen(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } CloseableExecutorService executor = getExecutorService(); agentThread = executor.submit(() -> { try { while (true) { long clientSock = Local.accept(handle); Socket.timeoutSet(clientSock, 10000000); // TODO make this configurable new SshAgentSession(clientSock, agent).run(); } } catch (Exception e) { log.error("Failed to run session", e); } }); return authSocket; }
public String start() throws Exception { authSocket = AprLibrary.createLocalSocketAddress(); pool = Pool.create(AprLibrary.getInstance().getRootPool()); handle = Local.create(authSocket, pool); int result = Local.bind(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } AprLibrary.secureLocalSocket(authSocket, handle); result = Local.listen(handle, 0); if (result != Status.APR_SUCCESS) { throwException(result); } CloseableExecutorService executor = getExecutorService(); agentThread = executor.submit(() -> { try { while (true) { long clientSock = Local.accept(handle); Socket.timeoutSet(clientSock, 10000000); // TODO make this configurable new SshAgentSession(clientSock, agent).run(); } } catch (Exception e) { log.error("Failed to run session", e); } }); return authSocket; }