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;
}
}download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1000962 |
| Snippet name: | suckFromChat / suckFromChatNoHistory |
| Eternal ID of this version: | #1000962/1 |
| Text MD5: | 5e7a7fa872824abb2306f27ff9b0e4e0 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-09-24 17:40:28 |
| Source code size: | 1321 bytes / 38 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1260 / 1444 |
| Referenced in: | #1002427 - Accellerating 629 (SPIKE) #1006654 - Standard functions list 2 (LIVE, continuation of #761) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |