Hi. I’m writing a component in Lucee to implement the Websocket Listener API. writeDump and writeLog inside the component cfc only works the first time.
For example, an excerpt:
function onHandshake(endpointConfig, request, response, sessionScope, applicationScope){
var rh = arguments.request.getHeaders();
writeDump(var = "#rh#", output = "console", label="request headers DUMP:");
return;
}
function onOpen(websocket, endpointConfig, sessionScope, applicationScope){
writeLog(text="new client connected");
//writeDump(var="#Variables#", output="console", label="Variables DUMP:");
//writeDump(var=arguments.websocket, output="console", label="arguments.websocket DUMP:");
var sessionscope = arguments.sessionScope;
Dump(var=sessionscope, output="console", label="sessionScope DUMP:")
try {
arguments.websocket.subscribe("all");
arguments.websocket.sendText("list");
return;
} catch (any e) {
WriteLog(exception="Error: " & e.message, type="error");
return false;
}
return;
}
Only the first writeDump(var = “#rh#”…) actually write anything to the console, and none of the others do anything (not even simple writeLog(“text without any variables”)).
Am I doing something wrong?