now service up to 69 concurrent requests

This commit is contained in:
Randy 2020-06-29 13:35:30 -06:00
parent ea49602ad1
commit 8279ebeddf

View File

@ -1,16 +1,24 @@
package org.sdf.git.fwix.gemini.server;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class FuckWixServer {
public static void main(String[] wixyPoo) throws Exception {
ServerSocket daddyWix = new ServerSocket(1965);
Executor kiddiePool = Executors.newFixedThreadPool(69);
while (true) {
try (Socket babbyWix = daddyWix.accept()) {
babbyWix.getOutputStream().write(
"20 text/plain\r\nFUCKWIX\r\n".getBytes());
}
Socket babbyWix = daddyWix.accept();
kiddiePool.execute(() -> {
try {
babbyWix.getOutputStream().write(
"20 text/plain\r\nFUCKWIX\r\n".getBytes());
babbyWix.close();
} catch (IOException e) { }
});
}
}
}