interacting with linknx using telnet via port 1028 is quite powerful, but has a little draw-back: it is not possible to terminate the session gracefully. Therefore I suggest to add another 'admin' command to do so ==> <admin><quit></quit></admin>
The following patch - based on the linknx-0.0.1.32 sources will do the trick. May by Jean-Francois will add this later to next release.
Have fun,
Klaus
***xmlserver.cpp2014-04-1314:36:23.575321861+0200---../../linknx-0.0.1.32/src/xmlserver.cpp2013-11-0700:21:29.000000000+0100***************XmlServer::~XmlServer()***45,51****close(fd_m);}!boolXmlServer::deregister(ClientConnection*con){connections_m.remove(con);return1;---45,52----close(fd_m);}!bool!XmlServer::deregister(ClientConnection*con){connections_m.remove(con);return1;***************voidXmlServer::Run(pth_sem_t*stop1)***156,162****if(cfd!=-1){ClientConnection*c=newClientConnection(this,cfd);-debugStream("XmlServer")<<"new client connection on port:"<<cfd<<endlog;connections_m.push_back(c);c->Start();}---157,162----***************ClientConnection::~ClientConnection()***186,195****voidClientConnection::Run(pth_sem_t*stop1){-boolquitLoop=false;-pth_event_tstop=pth_event(PTH_EVENT_SEM,stop1);!while((pth_event_status(stop)!=PTH_STATUS_OCCURRED)&&!quitLoop){if(readmessage(stop)==-1)break;---186,193----voidClientConnection::Run(pth_sem_t*stop1){pth_event_tstop=pth_event(PTH_EVENT_SEM,stop1);!while(pth_event_status(stop)!=PTH_STATUS_OCCURRED){if(readmessage(stop)==-1)break;***************voidClientConnection::Run(pth_sem_t****514,525****ticpp::Iterator<ticpp::Element>pAdmin;for(pAdmin=pMsg->FirstChildElement();pAdmin!=pAdmin.end();pAdmin++){!if(pAdmin->Value()=="quit")// klenssen: allow telnet sessions to be terminated actively!{!debugStream("ClientConnection")<<"ADMIN: received 'quit' command --> terminate active session"<<endlog;!quitLoop=true;!}!elseif(pAdmin->Value()=="save"){std::stringfilename=pAdmin->GetAttribute("file");if(filename=="")---512,518----ticpp::Iterator<ticpp::Element>pAdmin;for(pAdmin=pMsg->FirstChildElement();pAdmin!=pAdmin.end();pAdmin++){!if(pAdmin->Value()=="save"){std::stringfilename=pAdmin->GetAttribute("file");if(filename=="")***************intClientConnection::readmessage(pth_e***678,684****msg<<msgbuf_m;}!while((i=pth_read_ev(fd_m,&buf,sizeof(buf),stop))>0){std::stringtstr(buf,i);std::string::size_typelen=tstr.find_first_of('\004');---671,677----msg<<msgbuf_m;}!while((i=pth_read_ev(fd_m,&buf,256,stop))>0){std::stringtstr(buf,i);std::string::size_typelen=tstr.find_first_of('\004');
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
interacting with linknx using telnet via port 1028 is quite powerful, but has a little draw-back: it is not possible to terminate the session gracefully. Therefore I suggest to add another 'admin' command to do so ==> <admin><quit></quit></admin>
The following patch - based on the linknx-0.0.1.32 sources will do the trick. May by Jean-Francois will add this later to next release.
Have fun,
Klaus