Classes that inherit from both AmThread and AmEventHandler must inherit
from AmEventQueue first and from AmThread after. This is needed so that
the AmThread dtor is called first, which will trigger the thread to shut
down, which in turn makes sure nothing is waiting on the AmEventQueue's
condition variable.
Otherwise, if AmEventQueue is destroyed first while the corresponding
thread is still running and waiting on the condition variable, it will
be a deadlock.
With this, sems finally can shut down cleanly without having to be
killed by systemd.
Change-Id: I914455763b517c96561acb0b64fce26f127f44bc
Use overloading for the various flavours of str2int functions. This has
the benefit of automatically choosing the appropriate function for
aliased types that may be one or the other underlying type, such as
size_t.
Do a mass renaming of all relevant instances.
Change-Id: I7abb6b9031ee53332d2b04a6cba4a6cc667a4807
The commit fixes this:
JsonRPCServer.cpp: In static member function 'static int JsonRpcServer::processMessage(char*, unsigned int*, JsonrpcPeerConnection*)':
JsonRPCServer.cpp:135:49: warning: enum constant in boolean context [-Wint-in-bool-context]
135 | if (peer->flags && JsonrpcPeerConnection::FL_CLOSE_WRONG_REPLY) {
|
Change-Id: I7894f3e2727e384458ea736ad9555864894b0386
Due to the multiplexing of requests from several sources on to
json-rpc connections, when Jsonrpc requests are sent, the
application can not know the request ID which is to be used.
A new AmArg parameter to jsonrpc sendMessage and execRpc functions
can provide user data, which is copied into the response event,
and thus can be matched to the request in the application.
o sendMessage DI function
to send message into open connection
O execServerFunction DI function
execute server function as if received through json-rpc
o getServerPort DI function
get the server port the json-rpc server is listening on
o notification events of connection disconnect
o various fixes in protocol handling