I'm playing around with the Coldfusion Websockets and have been trying to follow this tutorial. However, I can't seem to get the channel listener part working for: "HelloWorld – Version 2: Using a channel listener".
I have the code in the application correct, but I think it can't find the cfclistener.
this.wschannels = [ {name="world", cfclistener="myChannelListener" }];
I have the cfc made with the beforePublish to append the time but it's not working. I'm using CFWheels and just put the channel listener cfc in the controllers folder. I tried the above code with different variations such as:
controllers/myChannelListener
/controllers/myChannelListener
controllers.myChannelListener
.controllers.myChannelListener
.. even trying the path from the C drive:
C:/Projects/myproject/controllers/myChannelListener
but they all do not work. I'm pretty sure it's a path problem. Does anyone know how to specify the cfclistener
path?
The event handler does not use your sites application.cfc file. Thus your cfwheels application is not even coming into play. The handler, cfclistener, path should be dot a dot notated path from the application root.
See:
https://learn.adobe.com/wiki/display/coldfusionen/Using+WebSocket+to+broadcast+messages
Scroll down to "Using channel listener functions"