362c1f4c3b5ce9e3fce11167a51fbe4cdb2174de
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h   1) /* Blinker
Stefan Schuermans update copyright header

Stefan Schuermans authored 5 years ago

src/common/Sender_impl.h   2)    Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h   3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
src/noarch/Sender_impl.h   4)    a blinkenarea.org project */
src/noarch/Sender_impl.h   5) 
Stefan Schuermans namespace for preprocessor...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h   6) #ifndef BLINKER_SENDER_IMPL_H
src/noarch/Sender_impl.h   7) #define BLINKER_SENDER_IMPL_H
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h   8) 
src/noarch/Sender_impl.h   9) #include <list>
src/noarch/Sender_impl.h  10) #include <map>
src/noarch/Sender_impl.h  11) #include <string>
src/noarch/Sender_impl.h  12) 
src/noarch/Sender_impl.h  13) #include <BlinkenLib/BlinkenProto.h>
src/noarch/Sender_impl.h  14) #include <BlinkenLib/BlinkenFrame.h>
src/noarch/Sender_impl.h  15) 
src/noarch/Sender_impl.h  16) #include "Directory.h"
src/noarch/Sender_impl.h  17) #include "File.h"
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  18) #include "InStreamFile.h"
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  19) #include "IoCallee.h"
Stefan Schuermans converted sender to use lis...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  20) #include "ListTracker.h"
src/noarch/Sender_impl.h  21) #include "ListTracker_impl.h"
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  22) #include "Mgrs.h"
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  23) #include "Module.h"
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  24) #include "Protocol.h"
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  25) #include "ProtocolFile.h"
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  26) #include "Sender.h"
src/noarch/Sender_impl.h  27) #include "SenderDest.h"
src/noarch/Sender_impl.h  28) #include "SenderDest_impl.h"
src/noarch/Sender_impl.h  29) #include "SettingFile.h"
src/noarch/Sender_impl.h  30) #include "StreamRecv.h"
src/noarch/Sender_impl.h  31) #include "Time.h"
src/noarch/Sender_impl.h  32) #include "TimeCallee.h"
src/noarch/Sender_impl.h  33) 
src/noarch/Sender_impl.h  34) namespace Blinker {
src/noarch/Sender_impl.h  35) 
src/noarch/Sender_impl.h  36) /**
src/noarch/Sender_impl.h  37)  * @brief constructor
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  38)  * @param[in] name module name
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  39)  * @param[in] mgrs managers
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  40)  * @param[in] dirBase base directory
src/noarch/Sender_impl.h  41)  */
src/noarch/Sender_impl.h  42) template<typename ADDR, typename SOCK>
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  43) Sender<ADDR, SOCK>::Sender(const std::string &name, Mgrs &mgrs,
src/noarch/Sender_impl.h  44)                            const Directory &dirBase):
src/noarch/Sender_impl.h  45)   Module(name, mgrs, dirBase),
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  46)   m_fileInStream(dirBase.getFile("instream"), mgrs.m_streamMgr),
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  47)   m_fileBind(dirBase.getFile("bind")),
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  48)   m_fileProtocol(dirBase.getFile("protocol")),
Stefan Schuermans converted sender to use lis...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  49)   m_pSock(NULL),
src/noarch/Sender_impl.h  50)   m_destListTracker(*this, dirBase.getSubdir("destinations"))
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  51) {
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  52)   // read protocol
src/noarch/Sender_impl.h  53)   readProto();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  54) 
Stefan Schuermans typos

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  55)   // attach to input stream
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  56)   m_fileInStream.setStreamRecv(this);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  57)   // create and bind socket
src/noarch/Sender_impl.h  58)   createSock();
src/noarch/Sender_impl.h  59) 
src/noarch/Sender_impl.h  60)   // load static destinations
Stefan Schuermans converted sender to use lis...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  61)   m_destListTracker.init();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  62) }
src/noarch/Sender_impl.h  63) 
src/noarch/Sender_impl.h  64) /// virtual destructor
src/noarch/Sender_impl.h  65) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h  66) Sender<ADDR, SOCK>::~Sender()
src/noarch/Sender_impl.h  67) {
src/noarch/Sender_impl.h  68)   // send "no frame" to all destinations
src/noarch/Sender_impl.h  69)   sendAllNoFrame();
src/noarch/Sender_impl.h  70) 
Stefan Schuermans converted sender to use lis...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  71)   // free static destinations
src/noarch/Sender_impl.h  72)   m_destListTracker.clear();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  73) 
src/noarch/Sender_impl.h  74)   // destroy socket
src/noarch/Sender_impl.h  75)   destroySock();
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  76)   // detach from input stream
src/noarch/Sender_impl.h  77)   m_fileInStream.setStreamRecv(NULL);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  78)   // cancel time callback
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  79)   m_mgrs.m_callMgr.cancelTimeCall(this);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  80) }
src/noarch/Sender_impl.h  81) 
src/noarch/Sender_impl.h  82) /// check for update of configuration
src/noarch/Sender_impl.h  83) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h  84) void Sender<ADDR, SOCK>::updateConfig()
src/noarch/Sender_impl.h  85) {
src/noarch/Sender_impl.h  86)   // input stream name file was modified -> re-get input stream
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  87)   if (m_fileInStream.checkModified())
src/noarch/Sender_impl.h  88)     m_fileInStream.update();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  89) 
src/noarch/Sender_impl.h  90)   // bind address file was modified -> re-create socket
src/noarch/Sender_impl.h  91)   if (m_fileBind.checkModified()) {
src/noarch/Sender_impl.h  92)     destroySock();
src/noarch/Sender_impl.h  93)     createSock();
src/noarch/Sender_impl.h  94)   }
src/noarch/Sender_impl.h  95) 
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h  96)   // protocol file was modified -> re-read protocol
src/noarch/Sender_impl.h  97)   if (m_fileProtocol.checkModified())
src/noarch/Sender_impl.h  98)     readProto();
src/noarch/Sender_impl.h  99) 
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 100)   // static destinations update
Stefan Schuermans converted sender to use lis...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 101)   m_destListTracker.updateConfig();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 102) }
src/noarch/Sender_impl.h 103) 
src/noarch/Sender_impl.h 104) /**
src/noarch/Sender_impl.h 105)  * @brief set current frame
src/noarch/Sender_impl.h 106)  * @param[in] stream stream name
Stefan Schuermans merged frame processing wit...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 107)  * @param[in] pFrame current frame (NULL for none)
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 108)  */
src/noarch/Sender_impl.h 109) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 110) void Sender<ADDR, SOCK>::setFrame(const std::string &stream,
src/noarch/Sender_impl.h 111)                                   stBlinkenFrame *pFrame)
src/noarch/Sender_impl.h 112) {
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 113)   // convert new frame to protocol data
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 114)   frame2data(pFrame, m_data);
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 115) 
src/noarch/Sender_impl.h 116)   // send new protocol data to all destinations
src/noarch/Sender_impl.h 117)   sendAllProto();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 118) 
src/noarch/Sender_impl.h 119)   (void)stream; // unused
src/noarch/Sender_impl.h 120) }
src/noarch/Sender_impl.h 121) 
Stefan Schuermans fixed comment typo

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 122) /// callback when requested time reached
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 123) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 124) void Sender<ADDR, SOCK>::timeCall()
src/noarch/Sender_impl.h 125) {
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 126)   // repeat current protocol data to all destinations
src/noarch/Sender_impl.h 127)   sendAllProto();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 128) }
src/noarch/Sender_impl.h 129) 
src/noarch/Sender_impl.h 130) /**
src/noarch/Sender_impl.h 131)  * @brief callback when I/O object is readable
src/noarch/Sender_impl.h 132)  * @param[in] io I/O object that is readable
src/noarch/Sender_impl.h 133)  */
src/noarch/Sender_impl.h 134) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 135) void Sender<ADDR, SOCK>::ioReadCall(Io *io)
src/noarch/Sender_impl.h 136) {
src/noarch/Sender_impl.h 137)   // reception on socket
src/noarch/Sender_impl.h 138)   if (io == m_pSock)
src/noarch/Sender_impl.h 139)     receiveFromSock();
src/noarch/Sender_impl.h 140) }
src/noarch/Sender_impl.h 141) 
src/noarch/Sender_impl.h 142) /**
src/noarch/Sender_impl.h 143)  * @brief callback when I/O object is writable
src/noarch/Sender_impl.h 144)  * @param[in] io I/O object that is writable
src/noarch/Sender_impl.h 145)  */
src/noarch/Sender_impl.h 146) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 147) void Sender<ADDR, SOCK>::ioWriteCall(Io *io)
src/noarch/Sender_impl.h 148) {
src/noarch/Sender_impl.h 149)   (void)io; // unused
src/noarch/Sender_impl.h 150) }
src/noarch/Sender_impl.h 151) 
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 152) /// (re-)read protocol
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 153) template<typename ADDR, typename SOCK>
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 154) void Sender<ADDR, SOCK>::readProto()
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 155) {
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 156)   // send "no frame" to all destinations
src/noarch/Sender_impl.h 157)   // (stream with old protocol will stop now)
src/noarch/Sender_impl.h 158)   sendAllNoFrame();
src/noarch/Sender_impl.h 159) 
src/noarch/Sender_impl.h 160)   // clear dynamic destinations
src/noarch/Sender_impl.h 161)   // (they registered with old protocol, which is out of service now)
src/noarch/Sender_impl.h 162)   m_dynDests.clear();
src/noarch/Sender_impl.h 163) 
src/noarch/Sender_impl.h 164)   // clear old frame data and old no frame data
src/noarch/Sender_impl.h 165)   m_noFrameData.clear();
src/noarch/Sender_impl.h 166)   m_data.clear();
src/noarch/Sender_impl.h 167) 
src/noarch/Sender_impl.h 168)   // read new protocol from file
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 169)   m_fileProtocol.update();
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 170) 
src/noarch/Sender_impl.h 171)   // create new no frame protocol data and new protocol data
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 172)   frame2data(NULL, m_noFrameData);
src/noarch/Sender_impl.h 173)   frame2data(m_fileInStream.getCurFrame(), m_data);
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 174) 
src/noarch/Sender_impl.h 175)   // send current protocol data to all destinations
src/noarch/Sender_impl.h 176)   sendAllProto();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 177) }
src/noarch/Sender_impl.h 178) 
src/noarch/Sender_impl.h 179) /// create socket and bind it
src/noarch/Sender_impl.h 180) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 181) void Sender<ADDR, SOCK>::createSock()
src/noarch/Sender_impl.h 182) {
src/noarch/Sender_impl.h 183)   // create socket
src/noarch/Sender_impl.h 184)   if (!m_pSock) {
src/noarch/Sender_impl.h 185)     m_pSock = new SOCK();
src/noarch/Sender_impl.h 186)     if (!m_pSock)
src/noarch/Sender_impl.h 187)       return;
src/noarch/Sender_impl.h 188)   }
src/noarch/Sender_impl.h 189) 
src/noarch/Sender_impl.h 190)   // get bind address from bind address setting file
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 191)   m_fileBind.update();
src/noarch/Sender_impl.h 192)   if (!m_fileBind.m_valid) {
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 193)     delete m_pSock;
src/noarch/Sender_impl.h 194)     m_pSock = NULL;
src/noarch/Sender_impl.h 195)     return;
src/noarch/Sender_impl.h 196)   }
src/noarch/Sender_impl.h 197) 
src/noarch/Sender_impl.h 198)   // bind socket
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 199)   if (!m_pSock->bind(m_fileBind.m_obj)) {
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 200)     delete m_pSock;
src/noarch/Sender_impl.h 201)     m_pSock = NULL;
src/noarch/Sender_impl.h 202)     return;
src/noarch/Sender_impl.h 203)   }
src/noarch/Sender_impl.h 204) 
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 205)   // request callback on recepetion
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 206)   m_mgrs.m_callMgr.requestIoReadCall(this, m_pSock);
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 207) 
src/noarch/Sender_impl.h 208)   // send current protocol data to all destinations
src/noarch/Sender_impl.h 209)   sendAllProto();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 210) }
src/noarch/Sender_impl.h 211) 
src/noarch/Sender_impl.h 212) /// destroy socket
src/noarch/Sender_impl.h 213) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 214) void Sender<ADDR, SOCK>::destroySock()
src/noarch/Sender_impl.h 215) {
src/noarch/Sender_impl.h 216)   // send "no frame" to all destinations
src/noarch/Sender_impl.h 217)   // (stream from this socket will stop now)
src/noarch/Sender_impl.h 218)   sendAllNoFrame();
src/noarch/Sender_impl.h 219) 
src/noarch/Sender_impl.h 220)   // clear dynamic destinations
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 221)   // (they registered with this socket and this socket is gone)
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 222)   m_dynDests.clear();
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 223) 
src/noarch/Sender_impl.h 224)   // cancel callback request
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 225)   m_mgrs.m_callMgr.cancelIoReadCall(this, m_pSock);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 226) 
src/noarch/Sender_impl.h 227)   // destroy socket
src/noarch/Sender_impl.h 228)   if (m_pSock) {
src/noarch/Sender_impl.h 229)     delete m_pSock;
src/noarch/Sender_impl.h 230)     m_pSock = NULL;
src/noarch/Sender_impl.h 231)   }
src/noarch/Sender_impl.h 232) }
src/noarch/Sender_impl.h 233) 
src/noarch/Sender_impl.h 234) /// remove timed-out dynamic destinations
src/noarch/Sender_impl.h 235) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 236) void Sender<ADDR, SOCK>::removeTimedOutDynDests()
src/noarch/Sender_impl.h 237) {
src/noarch/Sender_impl.h 238)   Time now, timeout;
src/noarch/Sender_impl.h 239)   typename DynDests::iterator itDyn;
src/noarch/Sender_impl.h 240) 
src/noarch/Sender_impl.h 241)   now = Time::now();
src/noarch/Sender_impl.h 242)   timeout = Time(30);
src/noarch/Sender_impl.h 243) 
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 244)   for (itDyn = m_dynDests.begin(); itDyn != m_dynDests.end(); )
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 245)     if (itDyn->second + timeout < now)
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 246)       m_dynDests.erase(itDyn++);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 247)     else
src/noarch/Sender_impl.h 248)       ++itDyn;
src/noarch/Sender_impl.h 249) }
src/noarch/Sender_impl.h 250) 
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 251) /// send current protocol data to all destinations
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 252) template<typename ADDR, typename SOCK>
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 253) void Sender<ADDR, SOCK>::sendAllProto()
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 254) {
src/noarch/Sender_impl.h 255)   // remove timed-out dynamic destinations
src/noarch/Sender_impl.h 256)   removeTimedOutDynDests();
src/noarch/Sender_impl.h 257) 
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 258)   // send current protocol data to all static/dynamic destinations
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 259)   sendDests(&m_data);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 260) 
src/noarch/Sender_impl.h 261)   // request time callback in one second
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 262)   m_mgrs.m_callMgr.requestTimeCall(this, Time::now() + Time(1));
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 263) }
src/noarch/Sender_impl.h 264) 
src/noarch/Sender_impl.h 265) /// send "no frame" to all destinations
src/noarch/Sender_impl.h 266) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 267) void Sender<ADDR, SOCK>::sendAllNoFrame()
src/noarch/Sender_impl.h 268) {
src/noarch/Sender_impl.h 269)   // remove timed-out dynamic destinations
src/noarch/Sender_impl.h 270)   removeTimedOutDynDests();
src/noarch/Sender_impl.h 271) 
src/noarch/Sender_impl.h 272)   // get "no frame" protocol data and send to all static/dynamic destinations
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 273)   sendDests(&m_noFrameData);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 274) 
src/noarch/Sender_impl.h 275)   // request time callback in one second
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 276)   m_mgrs.m_callMgr.requestTimeCall(this, Time::now() + Time(1));
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 277) }
src/noarch/Sender_impl.h 278) 
src/noarch/Sender_impl.h 279) /**
src/noarch/Sender_impl.h 280)  * @brief send data to static/dynamic destinations
src/noarch/Sender_impl.h 281)  * @param[in] data *pData protocol data to send
src/noarch/Sender_impl.h 282)  */
src/noarch/Sender_impl.h 283) template<typename ADDR, typename SOCK>
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 284) void Sender<ADDR, SOCK>::sendDests(const std::string *pData)
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 285) {
src/noarch/Sender_impl.h 286)   // send data to static destinations
Stefan Schuermans converted sender to use lis...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 287)   typename DestListTracker::ListIt itDest;
src/noarch/Sender_impl.h 288)   for (itDest = m_destListTracker.m_list.begin();
src/noarch/Sender_impl.h 289)        itDest != m_destListTracker.m_list.end(); ++itDest)
src/noarch/Sender_impl.h 290)     itDest->m_pObj->setProtoData(pData);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 291) 
src/noarch/Sender_impl.h 292)   // send data to all dynamic destinations
src/noarch/Sender_impl.h 293)   typename DynDests::const_iterator itDyn;
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 294)   for (itDyn = m_dynDests.begin(); itDyn != m_dynDests.end(); ++itDyn)
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 295)     sendProto(*pData, itDyn->first);
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 296) }
src/noarch/Sender_impl.h 297) 
src/noarch/Sender_impl.h 298) /**
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 299)  * @brief send protocol data to address
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 300)  * @param[in] data protocol data of frame (empty if unknown)
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 301)  * @param[in] addr address to send to
src/noarch/Sender_impl.h 302)  */
src/noarch/Sender_impl.h 303) template<typename ADDR, typename SOCK>
Stefan Schuermans simplified implementation o...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 304) void Sender<ADDR, SOCK>::sendProto(const std::string &data,
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 305)                                    const ADDR &addr) const
src/noarch/Sender_impl.h 306) {
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 307)   if (m_pSock && !data.empty())
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 308)     m_pSock->send(data, addr);
src/noarch/Sender_impl.h 309) }
src/noarch/Sender_impl.h 310) 
src/noarch/Sender_impl.h 311) /**
src/noarch/Sender_impl.h 312)  * @brief convert frame to protocol data
Stefan Schuermans merged frame processing wit...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 313)  * @param[in] pFrame frame (NULL for none)
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 314)  * @param[out] data protocol data
src/noarch/Sender_impl.h 315)  */
src/noarch/Sender_impl.h 316) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 317) void Sender<ADDR, SOCK>::frame2data(stBlinkenFrame *pFrame,
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 318)                                     std::string &data) const
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 319) {
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 320)   etBlinkenProto proto;
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 321)   char buf[65536];
src/noarch/Sender_impl.h 322)   int len;
src/noarch/Sender_impl.h 323) 
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 324)   // no protocol -> leave with empty data
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 325)   if (!m_fileProtocol.m_valid) {
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 326)     data.clear();
src/noarch/Sender_impl.h 327)     return;
src/noarch/Sender_impl.h 328)   }
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 329)   proto = m_fileProtocol.m_obj.m_proto;
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 330) 
Stefan Schuermans typo

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 331)   // convert frame to protocol data
Stefan Schuermans merged frame processing wit...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 332)   if (pFrame)
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 333)     len = BlinkenFrameToNetwork(pFrame, proto, buf, sizeof(buf));
Stefan Schuermans merged frame processing wit...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 334)   else
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 335)     len = BlinkenProtoMakePacket(proto, BlinkenPacketStreamEnd,
Stefan Schuermans merged frame processing wit...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 336)                                  buf, sizeof(buf));
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 337)   if (len < 0)
src/noarch/Sender_impl.h 338)     len = 0;
src/noarch/Sender_impl.h 339)   data.assign(buf, len);
src/noarch/Sender_impl.h 340) }
src/noarch/Sender_impl.h 341) 
src/noarch/Sender_impl.h 342) /// receive data from socket
src/noarch/Sender_impl.h 343) template<typename ADDR, typename SOCK>
src/noarch/Sender_impl.h 344) void Sender<ADDR, SOCK>::receiveFromSock()
src/noarch/Sender_impl.h 345) {
src/noarch/Sender_impl.h 346)   etBlinkenProto proto;
src/noarch/Sender_impl.h 347)   etBlinkenPacket packet;
src/noarch/Sender_impl.h 348)   std::string data;
src/noarch/Sender_impl.h 349)   ADDR addr;
src/noarch/Sender_impl.h 350) 
src/noarch/Sender_impl.h 351)   // make sure socket exists
src/noarch/Sender_impl.h 352)   if (!m_pSock)
src/noarch/Sender_impl.h 353)     return;
src/noarch/Sender_impl.h 354) 
src/noarch/Sender_impl.h 355)   // receive (leave if no reception)
src/noarch/Sender_impl.h 356)   if (!m_pSock->recv(data, addr))
src/noarch/Sender_impl.h 357)     return;
src/noarch/Sender_impl.h 358) 
src/noarch/Sender_impl.h 359)   // detect packet type and protocol
src/noarch/Sender_impl.h 360)   BlinkenProtoDetectPacket(data.c_str(), data.size(), &proto, &packet);
src/noarch/Sender_impl.h 361) 
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 362)   if (m_fileProtocol.m_valid && proto == m_fileProtocol.m_obj.m_proto) {
Stefan Schuermans simplified sender module a...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 363)     switch (packet) {
src/noarch/Sender_impl.h 364) 
src/noarch/Sender_impl.h 365)       // request -> add to dynamic destinations and send current frame
src/noarch/Sender_impl.h 366)       case BlinkenPacketRequest:
src/noarch/Sender_impl.h 367)         m_dynDests[addr] = Time::now();
src/noarch/Sender_impl.h 368)         sendProto(m_data, addr);
src/noarch/Sender_impl.h 369)         break;
src/noarch/Sender_impl.h 370) 
src/noarch/Sender_impl.h 371)       // end request -> remove from dynamic destinations
src/noarch/Sender_impl.h 372)       case BlinkenPacketEndRequest:
src/noarch/Sender_impl.h 373)         m_dynDests.erase(addr);
src/noarch/Sender_impl.h 374)         break;
src/noarch/Sender_impl.h 375) 
src/noarch/Sender_impl.h 376)       default:
src/noarch/Sender_impl.h 377)         break;
src/noarch/Sender_impl.h 378) 
src/noarch/Sender_impl.h 379)     } // switch (packet)
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 380)   } // if (m_fileProtocol.m_valid ...
Stefan Schuermans sender static destination n...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 381) }
src/noarch/Sender_impl.h 382) 
src/noarch/Sender_impl.h 383) } // namespace Blinker
src/noarch/Sender_impl.h 384) 
Stefan Schuermans namespace for preprocessor...

Stefan Schuermans authored 12 years ago

src/noarch/Sender_impl.h 385) #endif // #ifndef BLINKER_SENDER_H