58 static std::shared_ptr<UNetExchange>
init_unetexchange(
int argc,
const char*
const argv[],
59 uniset::ObjectId shmID,
const std::shared_ptr<SharedMemory>& ic = 0,
const std::string& prefix =
"unet" );
62 static void help_print(
int argc,
const char* argv[] )
noexcept;
64 bool checkExistTransport(
const std::string& transportID )
noexcept;
66 inline std::shared_ptr<LogAgregator> getLogAggregator()
noexcept
70 inline std::shared_ptr<DebugStream> log()
noexcept
77#ifndef DISABLE_REST_API
79 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
81 virtual Poco::JSON::Object::Ptr httpGetMyInfo( Poco::JSON::Object::Ptr root )
override;
83 Poco::JSON::Object::Ptr httpStatus();
84 Poco::JSON::Object::Ptr httpReceivers(
const Poco::URI::QueryParameters& p );
85 Poco::JSON::Object::Ptr httpSenders(
const Poco::URI::QueryParameters& p );
86 Poco::JSON::Object::Ptr httpGetParam(
const Poco::URI::QueryParameters& p );
87 Poco::JSON::Object::Ptr httpSetParam(
const Poco::URI::QueryParameters& p );
89 bool httpEnabledSetParams = {
false };
98 std::shared_ptr<SMInterface> shm;
104 void askSensors( UniversalIO::UIOCommand cmd );
106 void receiverEvent(
const std::shared_ptr<UNetReceiver>& r,
UNetReceiver::Event ev )
noexcept;
113 void termReceivers();
115 void initMulticastTransport(
UniXML::iterator nodes,
const std::string& n_field,
const std::string& n_fvalue,
const std::string& prefix );
118 void initUDPTransport(
UniXML::iterator nodes,
const std::string& n_field,
const std::string& n_fvalue,
const std::string& prefix);
119 void initIterators()
noexcept;
120 void startReceivers();
129 timeout_t initPause = { 0 };
134 timeout_t maxHeartBeat = { 10 };
135 IOController::IOStateList::iterator itHeartBeat;
138 timeout_t steptime = { 1000 };
140 std::atomic_bool activated = {
false };
141 std::atomic_bool cancelled = {
false };
142 timeout_t activateTimeout = { 20000 };
146 ReceiverInfo()
noexcept: r1(
nullptr), r2(
nullptr),
148 respondInvert(
false),
153 ReceiverInfo(
const std::shared_ptr<UNetReceiver>& _r1,
const std::shared_ptr<UNetReceiver>& _r2 )
noexcept:
156 respondInvert(
false),
161 std::shared_ptr<UNetReceiver> r1;
162 std::shared_ptr<UNetReceiver> r2;
164 void step(
const std::shared_ptr<SMInterface>& shm,
const std::string& myname, std::shared_ptr<DebugStream>& log )
noexcept;
166 inline void setRespondID(
uniset::ObjectId id,
bool invert =
false )
noexcept
169 respondInvert = invert;
182 sidChannelSwitchCount = id;
185 inline void initIterators(
const std::shared_ptr<SMInterface>& shm )
noexcept
187 shm->initIterator(itLostPackets);
188 shm->initIterator(itRespond);
189 shm->initIterator(itChannelNum);
190 shm->initIterator(itChannelSwitchCount);
199 IOController::IOStateList::iterator itRespond;
200 bool respondInvert = {
false };
202 IOController::IOStateList::iterator itLostPackets;
204 IOController::IOStateList::iterator itChannelNum;
206 long channelSwitchCount = { 0 };
208 IOController::IOStateList::iterator itChannelSwitchCount;
211 typedef std::deque<ReceiverInfo> ReceiverList;
212 ReceiverList recvlist;
214 bool no_sender = {
false };
215 std::shared_ptr<UNetSender> sender;
216 std::shared_ptr<UNetSender> sender2;
218 std::shared_ptr<LogAgregator> loga;
219 std::shared_ptr<DebugStream> unetlog;
220 std::shared_ptr<LogServer> logserv;
221 std::string logserv_host = {
""};
222 int logserv_port = {0};
static std::shared_ptr< UNetExchange > init_unetexchange(int argc, const char *const argv[], uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=0, const std::string &prefix="unet")
Definition UNetUDP/unetexchange.cc:730
Definition UHttpRequestHandler.h:87