Warning: session_start(): open(/var/lib/php/sessions/sess_1ng4sqmeqeapjk456s3hqejqfr, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!include once #1015699 // websocket
sbool webSocketOnMessage_withIdler_verbose;
static void webSocketOnMessage_withIdler(S url, final VF1 onMessage, double idleInterval) {
webSocketOnMessage_withIdler(url, onMessage, idleInterval, null);
}
static WebSocketClient webSocketOnMessage_withIdler(S url, final VF1 onMessage, final double idleInterval, fS initialMessage, fO... args) ctex {
WebSocketClient client = new WebSocketClient(new URI(url)) {
java.util.Timer idler;
public void onMessage(S s) {
if (!licensed()) ret with close(); // program exit
s = dropTrailingNullChars(s);
pcallF(onMessage, s);
}
public void onOpen(ServerHandshake handshake) {
if (nempty(initialMessage))
send(format(initialMessage, args));
idler = doEvery(idleInterval, r {
if (webSocketOnMessage_withIdler_verbose)
print("websocket idling");
send("");
});
}
public void onClose(int code, S reason, bool remote) {
cancelTimer(idler);
idler = null;
}
public void onError(Exception e) { printStackTrace(e); }
};
client.connect();
ret client;
}