static int suckFromChat_chatPort = 9751; static Socket suckFromChat_socket; static BufferedReader suckFromChat_in, suckFromChatNoHistory_in; static boolean suckFromChat_present; static S suckFromChatNoHistory() ctex { if (suckFromChatNoHistory_in == null) { startChatServerIfNotUp(); waitForChatServer(); final Socket s = new Socket("localhost", suckFromChat_chatPort+2); print("connected to chat"); suckFromChatNoHistory_in = new BufferedReader( new InputStreamReader(s.getInputStream(), "UTF-8")); } return suckFromChatNoHistory_in.readLine(); } static S suckFromChat() ctex { if (suckFromChat_in == null) { startChatServerIfNotUp(); waitForChatServer(); suckFromChat_socket = new Socket("localhost", suckFromChat_chatPort+1); print("connected to chat"); //reportToChat("Hey ho I'm sucking!"); suckFromChat_in = new BufferedReader( new InputStreamReader(suckFromChat_socket.getInputStream(), "UTF-8")); } S line = suckFromChat_in.readLine(); if (line != null && line.length() == 0) suckFromChat_present = true; // We have reached the present :) return line; } static void suckFromChat_close() ctex { if (suckFromChat_socket != null) { suckFromChat_socket.close(); suckFromChat_socket = null; } }