}
public Future<?> connect() throws IOException {
- return executorService.submit(new Callable<Void>() {
- @Override
- public Void call() throws Exception {
- clientSocket.set(new TextSocket(serverSocket.accept()));
- return null;
- }
+ return executorService.submit(() -> {
+ clientSocket.set(new TextSocket(serverSocket.accept()));
+ return null;
});
}
return clientSocket.get().collectUntil(lineMatcher);
}
- public void writeLine(String line) throws IOException {
- clientSocket.get().writeLine(line);
+ public void writeLine(String... lines) throws IOException {
+ for (String line : lines) {
+ clientSocket.get().writeLine(line);
+ }
}
public String readLine() throws IOException {