28 Dec 16:31
cxx-tools-svn Probleme bei Ubuntu 11.10 Oneiric
Hallo Liste, wie schonmal im Chat angesprochen habe ich hier Probleme, die svn-Version von cxxtools (und damit auch von tntnet) zu installieren. Um eine sauberes Environment zu garantieren, habe ich in einer virtuellen Maschine ein Ubuntu 11.10 installiert, danach noch folgendes ausgeführt: $ sudo apt-get install build-essential subversion automake libtool Danach habe ich ein $ svn co https://cxxtools.svn.sourceforge.net/svnroot/cxxtools/trunk/cxxtools cxxtools gemacht (rev. 1401), ein $ cd cxxtools ; ./autogen ; ./configure Das nun obligatorische make produziert mir folgenden Fehler: libtool: link: g++ -g -O2 -o .libs/httprequest httprequest.o ../src/http/.libs/libcxxtools-http.so -ldl -lnsl /usr/bin/ld: httprequest.o: undefined reference to symbol 'cxxtools::Timer::~Timer()' /usr/bin/ld: note: 'cxxtools::Timer::~Timer()' is defined in DSO /home/dmi/cxxtools/src/.libs/libcxxtools.so.7 so try adding it to the linker command line(Continue reading)
)
For example, in the xmlrpc::Service class, lots of templates with
different number of parameters (all these have the same code). I think
it'd be a good idea to use variadic templates to improve these code.
It also happens in callable.tpp
Also in xmlrpc::Service, it's passed to the registerFunctions
templates method a pointer to a function, which represents the
callback. The new stl, which is compatible with c++0x has a class
std::function which propuses to represent a function. But it can also
"match" a lambda function or a functor. It's really useful.
With std::function of use (fn *)(int) you can use
std::function<fn(int)>. It's really simple, but I've never checked if
it affects the performance.
Thanks in advance.
>
I created a small example which implements a session over xmlrpc. The idea is
to implement a rpc function, which returns an id, which can identify some
server side session structure. This id is passed to each rpc function to
identify the session.
The example do not handle session timeouts, but it is quite easy to add a
timer to the event loop of the xmlrpc server, which check for session timeout.
Then each call to a session must update the last access time. This can be
easily implemented in the method RpcSessionService::getSession.
You can find the example at:
RSS Feed