!636 !modern main { static new L database; static PrintWriter out; static BufferedReader in; psvm { ServerSocket ss = new ServerSocket(8888); print("port 8888 yo"); while (true) { print("and again!"); Socket clientSocket = ss.accept(); print("bing!"); out = new PrintWriter(clientSocket.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); //out.println("Hello!"); try { onClient(); } catch (RuntimeException e) { // don't die policy except on OutOfMemoryError (bad) e.printStackTrace(); } print("zap........."); clientSocket.close(); } } static S read_line_from_client() ctex { // we don't like "IOExceptions" return in.readLine(); } static void write_to_client(S s) { out.println(s); } static void disconnect_from_client() { // we do it anyway when the code is through } static void onClient() { S s = read_line_from_client(); database.add(s); print(quote(s) + "... oh yeah."); write_to_client("Thank you. You are number " + database.size() + " in our system."); disconnect_from_client(); } }