WS Connection should be fully established by the time WSInstanceListener::onAfterCreate method is called.
TimeStealsEverything opened this issue · 2 comments
TimeStealsEverything commented
void WSInstanceListener::onAfterCreate(const oatpp::websocket::WebSocket& socket, const std::shared_ptr<const ParameterMap>& params) {
SOCKETS ++;
OATPP_LOGD(TAG, "New Incoming Connection. Connection count=%d", SOCKETS.load());
/* In this particular case we create one WSListener per each connection */
/* Which may be redundant in many cases */
socket.setListener(std::make_shared<WSListener>());
std::thread t([&socket]{
socket.sendOneFrameText("Hello");
});
t.detach();
}
TimeStealsEverything commented
WS Connection should be fully established by the time WSInstanceListener::onAfterCreate method is called.
lganzzzo commented
Fixed in oatpp/oatpp#532