MCPcopy Create free account
hub / github.com/cocos/cocos-engine / closeAsync

Method closeAsync

native/cocos/network/WebSocketServer.cpp:179–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void WebSocketServer::closeAsync(const std::function<void(const ccstd::string &errorMsg)> &callback) {
180 if (_serverState.load() != ServerThreadState::RUNNING) {
181 return;
182 }
183 RUN_IN_SERVERTHREAD(this->close(callback));
184}
185
186void WebSocketServer::listen(const std::shared_ptr<WebSocketServer> &server, int port, const ccstd::string &host, const std::function<void(const ccstd::string &errorMsg)> &callback) {
187 auto tryLock = server->_serverLock.try_lock();

Callers 7

stopMethod · 0.45
disconnectMethod · 0.45
WebSocketServer_closeFunction · 0.45
onMessageMethod · 0.45
webSocketFinalizeFunction · 0.45
webSocketCloseFunction · 0.45

Calls 2

closeMethod · 0.95
loadMethod · 0.45

Tested by

no test coverage detected