diff --git a/ivette/src/frama-c/client.ts b/ivette/src/frama-c/client.ts index 526c942b6b8b47a200169f7d4f5783425c84a64d..d9cd89613c4cd84777962e16f7a5baa7a3fcef03 100644 --- a/ivette/src/frama-c/client.ts +++ b/ivette/src/frama-c/client.ts @@ -28,6 +28,9 @@ import { json } from 'dome/data/json'; export interface Client { + /** Server CLI */ + commandLine(sockaddr: string, params: string[]): string[]; + /** Connection */ connect(addr: string): void; diff --git a/ivette/src/frama-c/client_socket.ts b/ivette/src/frama-c/client_socket.ts index 55be45c292f1bae5df6f3d9cb8eb762c812d31dd..cab6beb75b7c93017c29c93c4468899e4e7196d6 100644 --- a/ivette/src/frama-c/client_socket.ts +++ b/ivette/src/frama-c/client_socket.ts @@ -40,6 +40,11 @@ class SocketClient implements Client { queue: json[] = []; buffer: Buffer = Buffer.from(''); + /** Server CLI */ + commandLine(sockaddr: string, params: string[]): string[] { + return ['-server-socket', sockaddr, '-then'].concat(params); + } + /** Connection */ connect(sockaddr: string): void { if (this.socket) { diff --git a/ivette/src/frama-c/client_zmq.ts b/ivette/src/frama-c/client_zmq.ts index e3432ca39a52fc9d831426d29d381a93b50ee3e0..29db9cad74dd86d6b742df951c41e5ca560b1934 100644 --- a/ivette/src/frama-c/client_zmq.ts +++ b/ivette/src/frama-c/client_zmq.ts @@ -33,15 +33,17 @@ const pollingTimeout = 50; class ZmqClient implements Client { - constructor() { } - events = new Emitter(); - queueCmd: string[] = []; queueId: string[] = []; zmqSocket: ZmqRequest | undefined; zmqIsBusy = false; + /** Server CLI */ + commandLine(sockaddr: string, params: string[]): string[] { + return ['-server-zmq', sockaddr, '-then'].concat(params); + } + /** Connection */ connect(sockaddr: string): void { if (!this.zmqSocket) { diff --git a/ivette/src/frama-c/server.ts b/ivette/src/frama-c/server.ts index 5c2ba0038e98cfab8a8e3f9299915002240374ed..4edad8f1676aa266bf6fba52e1c3819330189eb7 100644 --- a/ivette/src/frama-c/server.ts +++ b/ivette/src/frama-c/server.ts @@ -458,7 +458,7 @@ async function _launch() { if (!cwd) cwd = System.getWorkingDir(); logout = logout && System.join(cwd, logout); logerr = logerr && System.join(cwd, logerr); - params = ['-server-zmq', sockaddr, '-then'].concat(params); + params = client.commandLine(sockaddr, params); const options = { cwd, stdout: { path: logout, pipe: true },