mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-12 16:46:42 +02:00
Remove unused virtual stop call
This commit is contained in:
parent
63de108800
commit
787d0714c0
2 changed files with 2 additions and 30 deletions
|
@ -47,11 +47,6 @@ StreamControl::StreamControl(const boost::asio::any_io_executor& executor) : exe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StreamControl::~StreamControl()
|
|
||||||
{
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void StreamControl::start(const std::string& stream_id, const ServerSettings& server_setttings, const OnNotification& notification_handler,
|
void StreamControl::start(const std::string& stream_id, const ServerSettings& server_setttings, const OnNotification& notification_handler,
|
||||||
const OnRequest& request_handler, const OnLog& log_handler)
|
const OnRequest& request_handler, const OnLog& log_handler)
|
||||||
|
@ -78,10 +73,6 @@ void StreamControl::command(const jsonrpcpp::Request& request, const OnResponse&
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void StreamControl::stop()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void StreamControl::onReceive(const std::string& json)
|
void StreamControl::onReceive(const std::string& json)
|
||||||
{
|
{
|
||||||
|
@ -157,6 +148,7 @@ ScriptStreamControl::ScriptStreamControl(const boost::asio::any_io_executor& exe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ScriptStreamControl::doStart(const std::string& stream_id, const ServerSettings& server_setttings)
|
void ScriptStreamControl::doStart(const std::string& stream_id, const ServerSettings& server_setttings)
|
||||||
{
|
{
|
||||||
pipe_stderr_ = bp::pipe();
|
pipe_stderr_ = bp::pipe();
|
||||||
|
@ -248,21 +240,4 @@ void ScriptStreamControl::stdoutReadLine()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ScriptStreamControl::stop()
|
|
||||||
{
|
|
||||||
if (process_.running())
|
|
||||||
{
|
|
||||||
LOG(INFO, LOG_TAG) << "Stopping script '" << script_ << "'\n";
|
|
||||||
::kill(-process_.native_handle(), SIGINT);
|
|
||||||
auto timeout = 500ms;
|
|
||||||
if (!process_.wait_for(timeout))
|
|
||||||
{
|
|
||||||
LOG(INFO, LOG_TAG) << "Script did not terminate after " << timeout.count() << " ms, terminating.\n";
|
|
||||||
process_.terminate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace streamreader
|
} // namespace streamreader
|
||||||
|
|
|
@ -59,11 +59,10 @@ public:
|
||||||
using OnLog = std::function<void(std::string message)>;
|
using OnLog = std::function<void(std::string message)>;
|
||||||
|
|
||||||
StreamControl(const boost::asio::any_io_executor& executor);
|
StreamControl(const boost::asio::any_io_executor& executor);
|
||||||
virtual ~StreamControl();
|
virtual ~StreamControl() = default;
|
||||||
|
|
||||||
void start(const std::string& stream_id, const ServerSettings& server_setttings, const OnNotification& notification_handler,
|
void start(const std::string& stream_id, const ServerSettings& server_setttings, const OnNotification& notification_handler,
|
||||||
const OnRequest& request_handler, const OnLog& log_handler);
|
const OnRequest& request_handler, const OnLog& log_handler);
|
||||||
virtual void stop();
|
|
||||||
|
|
||||||
void command(const jsonrpcpp::Request& request, const OnResponse& response_handler);
|
void command(const jsonrpcpp::Request& request, const OnResponse& response_handler);
|
||||||
|
|
||||||
|
@ -91,8 +90,6 @@ public:
|
||||||
ScriptStreamControl(const boost::asio::any_io_executor& executor, const std::string& script, const std::string& params);
|
ScriptStreamControl(const boost::asio::any_io_executor& executor, const std::string& script, const std::string& params);
|
||||||
virtual ~ScriptStreamControl() = default;
|
virtual ~ScriptStreamControl() = default;
|
||||||
|
|
||||||
void stop() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Send a message to stdin of the process
|
/// Send a message to stdin of the process
|
||||||
void doCommand(const jsonrpcpp::Request& request) override;
|
void doCommand(const jsonrpcpp::Request& request) override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue