69 UNetSender( std::unique_ptr<UNetSendTransport>&& transport,
const std::shared_ptr<SMInterface>& smi
70 ,
bool nocheckConnection =
false
71 ,
const std::string& s_field =
""
72 ,
const std::string& s_fvalue =
""
73 ,
const std::string& prop_prefix =
"unet"
74 ,
const std::string& prefix =
"unet"
75 ,
size_t maxDCount = UniSetUDP::MaxDCount
76 ,
size_t maxACount = UniSetUDP::MaxACount );
80 typedef size_t sendfactor_t;
82 static const long not_specified_value = { std::numeric_limits<long>::max() };
93 iotype(UniversalIO::UnknownIOType),
99 UniversalIO::IOType iotype;
101 IOController::IOStateList::iterator ioit;
104 sendfactor_t pack_sendfactor = { 0 };
105 long undefined_value = { not_specified_value };
106 friend std::ostream& operator<<( std::ostream& os,
UItem& p );
109 typedef std::unordered_map<uniset::ObjectId, UItem> UItemMap;
111 size_t getDataPackCount() const noexcept;
116 void send() noexcept;
140 inline void setSendPause(
int msec )
noexcept
144 inline void setPackSendPause(
int msec )
noexcept
146 packsendpause = msec;
148 inline void setPackSendPauseFactor(
int factor )
noexcept
150 packsendpauseFactor = factor;
155 void setCheckConnectionPause(
int msec )
noexcept;
158 void askSensors( UniversalIO::UIOCommand cmd );
168 std::string getShortInfo() const noexcept;
170#ifndef DISABLE_REST_API
171 Poco::JSON::Object::Ptr httpInfo( Poco::JSON::Object::Ptr root )
const;
174 inline size_t getADataSize() const noexcept
178 inline size_t getDDataSize() const noexcept
185 std::string s_field = {
"" };
186 std::string s_fvalue = {
"" };
187 std::string prop_prefix = {
"" };
189 const std::shared_ptr<SMInterface> shm;
190 std::shared_ptr<DebugStream> unetlog;
192 bool initItem( UniXML::iterator& it );
193 bool readItem(
const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec );
195 void readConfiguration();
197 bool createConnection(
bool throwEx );
202 std::unique_ptr<UNetSendTransport> transport;
204 std::string myname = {
"" };
205 timeout_t sendpause = { 150 };
206 timeout_t packsendpause = { 5 };
207 int packsendpauseFactor = { 1 };
208 timeout_t writeTimeout = { 1000 };
209 std::atomic_bool activated = {
false };
210 PassiveTimer ptCheckConnection;
214 IOController::IOStateList::iterator itMode;
217 typedef std::unordered_map<sendfactor_t, std::vector<PackMessage>> Packs;
223 std::unordered_map<sendfactor_t, size_t> packs_anum;
224 std::unordered_map<sendfactor_t, size_t> packs_dnum;
226 size_t packetnum = { 1 };
228 size_t maxAData = { UniSetUDP::MaxACount };
229 size_t maxDData = { UniSetUDP::MaxDCount };
231 std::unique_ptr< ThreadCreator<UNetSender> > s_thr;
233 size_t ncycle = { 0 };