#pragma once

#include "socket_adapter.h"
#include <saas/protos/rtyserver.pb.h>

class TSocketAdapterProto2Http: public ISocketAdapter {
private:
    TString Service;
    TString BuildJson(const NRTYServer::TMessage& message) const;
    mutable bool UsedToWrite;
    mutable bool UsedToRead;
    mutable ui64 MessageId;
    bool Realtime;
public:
    TSocketAdapterProto2Http(const TString& service, IInputStream& input, IOutputStream& output, bool realtime);
    virtual bool ReadMessage(::google::protobuf::Message& message) const override;
    virtual void WriteMessage(const ::google::protobuf::Message& message, const TString& request="") const override;
    virtual void WriteMessage(const TString& message, const TString& request) const override;
    virtual ~TSocketAdapterProto2Http() override {}
protected:
};

