| 177 | } |
| 178 | |
| 179 | void 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 | |
| 186 | void 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(); |
no test coverage detected