Warning: session_start(): open(/var/lib/php/sessions/sess_1ko8sfhpjq99q36ch3sgdsplvi, 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
sS hInitWebSocket(O... _) {
optPar S wsVar = "ws";
optPar S onOpen;
optPar S onMessage;
optPar S readyMsg = "WebSocket ready!";
ret hreconnectingWebSockets()
+ hscript([[
var wsReady = false;
var wsInitialMsgs = [];
var wsVerbose = false;
var ]] + wsVar + [[ = new ReconnectingWebSocket(((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + "/");
]] + wsVar + [[.onopen = function(event) {
wsReady = true;
console.log(]] + jsQuote(readyMsg) + [[);
wsInitialMsgs.forEach(function(msg) {
if (wsVerbose) console.log("Sending initial msg: " + msg);
ws.send(msg);
});
]] + jsDropTrailingComments(onOpen) + [[ };
]] + wsVar + [[.onmessage = function(event) {
]] + unnull(onMessage) + [[
};
// add an initial message to send when websocket opens
// also send it now if ws is open already
function wsInitialMsg(msg) {
wsInitialMsgs.push(msg);
if (wsReady) {
if (wsVerbose) console.log("Sending initial msg: " + msg);
ws.send(msg);
}
}
]]);
}