mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 08:23:34 -05:00
Added IConsoleListener
This commit is contained in:
@@ -23,9 +23,11 @@
|
||||
|
||||
|
||||
#include "Console.h"
|
||||
#include "interfaces/IConsoleListener.h"
|
||||
|
||||
|
||||
Console::Console()
|
||||
Console::Console(IConsoleListener *listener)
|
||||
: m_listener(listener)
|
||||
{
|
||||
m_tty.data = this;
|
||||
uv_tty_init(uv_default_loop(), &m_tty, 0, 1);
|
||||
@@ -50,6 +52,6 @@ void Console::onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
|
||||
}
|
||||
|
||||
if (nread == 1) {
|
||||
printf("%c\n", buf->base[0]);
|
||||
static_cast<Console*>(stream->data)->m_listener->onConsoleCommand(buf->base[0]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user