#include "Ipc/IpcMoudle.h"

#include "Core/Core.h"
#include "Ipc/ipclib.h"

IpcMoudle* Singleton<IpcMoudle>::instance_ = nullptr;

bool IpcMoudle::Initialize() {
    if (!initialize("ipc_sender", "ipc_sender")) {
        ERRORLOG("ipc initialize failed");
        return false;
    }

    setReaderCallback([](const char* data, unsigned int size) {
        INFOLOG("ipc recive data:{}", size);
        }
    );

    if (!listen()) {
        ERRORLOG("ipc listen failed");
        return false;
    }
    return true;
}

void IpcMoudle::Uninitialize() {
    uninitialize();
}
