#ifndef SOCKETSERVER_H
#define SOCKETSERVER_H

#include <QObject>
#include <QVector>

#include "event.h"

/**
 * Unix domain socket (abstract namespace).
 */
static const std::string SOCKET_NAME{"\0/InputGatherServer", 10}; // NOLINT

class SocketServer : public QObject
{
public:
    static SocketServer* self(QObject *parent = nullptr);
    ~SocketServer();

    static void processSignal(int signo){};
    void run();
    void send(Event event);

private:
    SocketServer(QObject *parent = nullptr);

    static SocketServer *_self;

    int m_socket;
    QVector<int> m_clients;
};

#endif // SOCKETSERVER_H
