42 LogSession(
const Poco::Net::StreamSocket& s, std::shared_ptr<DebugStream>& log, timeout_t cmdTimeout = 2000, timeout_t checkConnectionTime = 10000 );
45 typedef sigc::slot<void, LogSession*> FinalSlot;
46 void connectFinalSession( FinalSlot sl )
noexcept;
50 typedef sigc::signal<std::string, LogSession*, LogServerTypes::Command, const std::string& > LogSessionCommand_Signal;
51 LogSessionCommand_Signal signal_logsession_command();
54 void cancel()
noexcept;
56 std::string getClientAddress()
const noexcept;
58 void setSessionLogLevel( Debug::type t )
noexcept;
59 void addSessionLogLevel( Debug::type t )
noexcept;
60 void delSessionLogLevel( Debug::type t )
noexcept;
64 size_t getMaxBufSize()
const noexcept;
67 void run(
const ev::loop_ref& loop )
noexcept;
70 bool isAcive()
const noexcept;
72 std::string name()
const noexcept;
73 std::string getShortInfo()
noexcept;
75#ifndef DISABLE_REST_API
76 Poco::JSON::Object::Ptr httpGetShortInfo();
82 void event( ev::async& watcher,
int revents )
noexcept;
83 void callback( ev::io& watcher,
int revents )
noexcept;
84 void readEvent( ev::io& watcher )
noexcept;
85 void writeEvent( ev::io& watcher );
86 size_t readData(
unsigned char* buf,
int len );
88 void onCmdTimeout( ev::timer& watcher,
int revents )
noexcept;
89 void onCheckConnectionTimer( ev::timer& watcher,
int revents )
noexcept;
90 void final()
noexcept;
92 void logOnEvent(
const std::string& s )
noexcept;
94 timeout_t cmdTimeout = { 2000 };
95 double checkConnectionTime = { 10. };
104 size_t maxRecordsNum = { 30000 };
107 std::queue<UTCPCore::Buffer*> logbuf;
108 std::mutex logbuf_mutex;
109 bool lostMsg = {
false };
112 size_t maxCount = { 0 };
113 size_t minSizeMsg = { 0 };
114 size_t maxSizeMsg = { 0 };
115 size_t numLostMsg = { 0 };
117 std::string peername = {
"" };
118 std::string caddr = {
"" };
119 std::shared_ptr<DebugStream> log;
120 std::shared_ptr<LogAgregator> alog;
121 sigc::connection conn;
123 std::shared_ptr<UTCPStream> sock;
127 ev::async asyncEvent;
128 ev::timer checkConnectionTimer;
131 std::atomic_bool cancelled = {
false };
133 LogSessionCommand_Signal m_command_sig;