#pragma once


#include <memory>
#include <mutex>
#include <zmq.hpp>
#include <cstdint>
#include <string>


namespace WHISPER {

    class localClient
    {
        public:
        localClient(std::uint32_t port,std::string addr,std::uint32_t parentid,std::uint32_t id, std::shared_ptr<zmq::socket_t> clientSocket);
        ~localClient();


        
        std::uint32_t getPort();
        std::string getAddr();
        std::uint32_t getParentid();
        std::uint32_t getID();
        
        void addClientSocket(std::shared_ptr<zmq::socket_t> socket);
        std::shared_ptr<zmq::socket_t> getClientSocket();

        std::time_t getLastResponse();
        void setLastResponse(std::time_t time);

        private:

        mutable std::mutex mx;

        const std::uint32_t port_;
        const std::string addr_;
        const std::uint32_t parentid_;
        const std::uint32_t id_;
        std::shared_ptr<zmq::socket_t> clientSocket_;
        std::time_t lastResponse_;

    };

}