mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Merge branch 'v3.6.2' of github.com:cocos-creator/engine into v3.6.1-sync
This commit is contained in:
@@ -94,11 +94,13 @@ void schedule_task_into_server_thread_task_queue(uv_async_t *async, std::functio
|
||||
namespace cc {
|
||||
namespace network {
|
||||
|
||||
#define RUN_IN_GAMETHREAD(task) \
|
||||
do { \
|
||||
CC_CURRENT_ENGINE()->getScheduler()->performFunctionInCocosThread([=]() { \
|
||||
task; \
|
||||
}); \
|
||||
#define RUN_IN_GAMETHREAD(task) \
|
||||
do { \
|
||||
if (CC_CURRENT_APPLICATION()) { \
|
||||
CC_CURRENT_ENGINE()->getScheduler()->performFunctionInCocosThread([=]() { \
|
||||
task; \
|
||||
}); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define DISPATCH_CALLBACK_IN_GAMETHREAD() \
|
||||
@@ -386,7 +388,10 @@ WebSocketServerConnection::~WebSocketServerConnection() {
|
||||
|
||||
bool WebSocketServerConnection::send(std::shared_ptr<DataFrame> data) {
|
||||
_sendQueue.emplace_back(data);
|
||||
onDrainMessage();
|
||||
if (!_wsi || _closed || _readyState == ReadyState::CLOSING) {
|
||||
return false;
|
||||
}
|
||||
lws_callback_on_writable(_wsi);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user