| 67 | } |
| 68 | |
| 69 | void local_server::halt() { |
| 70 | std::scoped_lock const lock{mtx_}; |
| 71 | if (is_value(state_).any_of(state_e::HALTED, state_e::STOPPED)) { |
| 72 | VSOMEIP_WARNING_P << "Rejecting the attempt to stop the server when it is already stopped"; |
| 73 | return; |
| 74 | } |
| 75 | state_ = state_e::HALTED; |
| 76 | ++lc_count_; |
| 77 | boost::system::error_code ec; |
| 78 | acceptor_->cancel(ec); |
| 79 | if (ec) { |
| 80 | VSOMEIP_ERROR_P << "Error encountered: " << ec.message() << ", self: " << this; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | void local_server::block_from(const boost::asio::ip::address& _address) { |
| 85 | std::scoped_lock const lock{mtx_}; |