admin管理员组文章数量:1124532
I'm using the excellent Drogon C++ Web Framework and having difficulty figuring out how to create a dynamic route, i.e. on the fly as the app is running, for a custom WebSocketController instance.
I want to spin up an instance of the custom web-socket controller with a path determined at run time. It is straightforward to create a web-socket controller when we know the paths in advance but seems to be anything but straightforward for the dynamic case.
It is possible there is a better way to handle this and I am looking for anyone that may of implemented the dynamic case.
I thought I had a solution but I get a runtime assert in the app().run() method for the variable routersInit_ and I don't see anywhere in the framework where this variable gets set to true, so it is very confusing.
Thanks
Created a custom web-socket controller. Removed the ADD_PATH macros. Added a custom registerSelf__(path, {}); within the constructor of the custom web-socket controller.
本文标签: Drogon C Web FrameworkWebSocketController QuestionStack Overflow
版权声明:本文标题:Drogon C++ Web Framework - WebSocketController Question - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736638729a1945943.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论