MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / close

Method close

source/MaaPlayCoverControlUnit/Client/PlayToolsClient.cpp:40–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void PlayToolsClient::close()
41{
42 screen_size_ = { 0, 0 };
43
44 if (!socket_.is_open()) {
45 return;
46 }
47
48 boost::system::error_code ec;
49 socket_.shutdown(tcp::socket::shutdown_both, ec);
50 if (ec && ec != boost::asio::error::not_connected) {
51 LogWarn << "Error during socket shutdown:" << ec.message();
52 }
53
54 ec.clear();
55 socket_.close(ec);
56 if (ec) {
57 LogWarn << "Error during socket close:" << ec.message();
58 }
59}
60
61bool PlayToolsClient::connected() const
62{

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected