66 UNetSender( std::unique_ptr<UNetSendTransport>&& transport,
const std::shared_ptr<SMInterface>& smi
67 ,
bool nocheckConnection =
false
68 ,
const std::string& s_field =
""
69 ,
const std::string& s_fvalue =
""
70 ,
const std::string& prop_prefix =
"unet"
71 ,
const std::string& prefix =
"unet"
72 ,
size_t maxDCount = UniSetUDP::MaxDCount
73 ,
size_t maxACount = UniSetUDP::MaxACount );
77 typedef size_t sendfactor_t;
79 static const long not_specified_value = { std::numeric_limits<long>::max() };
90 iotype(UniversalIO::UnknownIOType),
96 UniversalIO::IOType iotype;
98 IOController::IOStateList::iterator ioit;
101 sendfactor_t pack_sendfactor = { 0 };
102 long undefined_value = { not_specified_value };
103 friend std::ostream& operator<<( std::ostream& os,
UItem& p );
106 typedef std::unordered_map<uniset::ObjectId, UItem> UItemMap;
108 size_t getDataPackCount() const noexcept;
113 void send() noexcept;
137 inline void setSendPause(
int msec )
noexcept
141 inline void setPackSendPause(
int msec )
noexcept
143 packsendpause = msec;
145 inline void setPackSendPauseFactor(
int factor )
noexcept
147 packsendpauseFactor = factor;
152 void setCheckConnectionPause(
int msec )
noexcept;
155 void askSensors( UniversalIO::UIOCommand cmd );
165 std::string getShortInfo() const noexcept;
167 inline
size_t getADataSize() const noexcept
171 inline size_t getDDataSize() const noexcept
178 std::string s_field = {
"" };
179 std::string s_fvalue = {
"" };
180 std::string prop_prefix = {
"" };
182 const std::shared_ptr<SMInterface> shm;
183 std::shared_ptr<DebugStream> unetlog;
185 bool initItem( UniXML::iterator& it );
186 bool readItem(
const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec );
188 void readConfiguration();
190 bool createConnection(
bool throwEx );
195 std::unique_ptr<UNetSendTransport> transport;
197 std::string myname = {
"" };
198 timeout_t sendpause = { 150 };
199 timeout_t packsendpause = { 5 };
200 int packsendpauseFactor = { 1 };
201 timeout_t writeTimeout = { 1000 };
202 std::atomic_bool activated = {
false };
203 PassiveTimer ptCheckConnection;
207 IOController::IOStateList::iterator itMode;
210 typedef std::unordered_map<sendfactor_t, std::vector<PackMessage>> Packs;
216 std::unordered_map<sendfactor_t, size_t> packs_anum;
217 std::unordered_map<sendfactor_t, size_t> packs_dnum;
219 size_t packetnum = { 1 };
221 size_t maxAData = { UniSetUDP::MaxACount };
222 size_t maxDData = { UniSetUDP::MaxDCount };
224 std::unique_ptr< ThreadCreator<UNetSender> > s_thr;
226 size_t ncycle = { 0 };