summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities/src/CAmSocketHandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* FOO: Issue #26 fix white space issues and apply new coding styleJens Lorenz2018-07-031-414/+502
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* codestyle: Remove empty single line c++ comments in ctor initializersJens Lorenz2018-06-201-10/+10
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Fix inconsistent fdPollingArrayJens Lorenz2018-06-121-42/+73
| | | | | | | | | | | | | | | | In case someone removed a fd and closed it opened a new one and added it to the socket handler the container state of the object in map was changed from either REMOVE/CLOSE to UNINIT. This leads to the emplace call in the fdPollingArray vector and the fd is maintained twice. Over the entire runtime there will be zombie fds provided to ppoll functions which will race a POLLERR revent leading to 100% cpu load. Also the CLOSE state is now removed because only the application is aware if a fd has to be closed. For instance calling add/remove in a loop were start_listenting is not running will turn to a system issue were no fds can be provided by the operation system. Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: No check callback needed for eventfd and signalfdJens Lorenz2018-04-091-5/+2
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Change log level of removeFDPoll from error to warningJens Lorenz2018-04-091-1/+1
| | | | | | | It is not an error in case the requested fdpoll is not part of the internal database. I just worth to print a warning here. Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Store signalfd as file descriptor instead of pollfd handleJens Lorenz2018-04-091-43/+20
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Wakeup of ppoll is now also triggered on addFdPollJens Lorenz2018-04-091-16/+16
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Fix startup sequence addFdPoll and removeFdPollJens Lorenz2018-04-091-4/+12
| | | | | | | | | | In case plugins add new fdpoll elements and directly removing them afterwards the state inside the structure will be changed to REMOVE. REMOVE will lead all the time to an erase which will not work in case the pointer is at .end() of vector or the element itself is not the correct one. Both cases will be fixed just by checking if the fd is the same. Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Cleanup indents and whitespacesJens Lorenz2018-04-091-10/+10
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Rework of exception debug messagesJens Lorenz2018-04-091-13/+15
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: ONLY timers will be closed in worker threadJens Lorenz2018-04-091-7/+14
| | | | | | | The removeFDPoll API is extended to allow applications to close the fd by the central worker thread. Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Rework of socketHandler to avoid calls of invalidated objectsJens Lorenz2018-04-091-115/+140
| | | | | | | | | | | | | | | | | | | This patch tries to follow the idea raised in PR26. Following two patches have been reworked: commit: cfe0e77aaf87a0590ceea42f6afa62b0c7d95e80 commit: bc33226f59910a960f62d419ba10d4ea761e3724 The biggest change applies to the internal database. Instead of having a vector for all items which will be copied inside the worker thread the new approach aims a central map which allows to store the sh_poll elements in containers. By this a container is valid until it is remove from map. The remove of items inside a map is now centralized within the worker and only the worker is responsible to keep the ppoll list and the map in sync. This patch also extends the unit tests to stress different timer scenarios. Signed-off-by: Aleksandar Donchev <Aleksander.Donchev@partner.bmw.de> Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Change from mPipe to eventfdJens Lorenz2018-04-091-15/+38
| | | | | | This commit is the first commit of a rework of the CAmSochetHandler class. Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Improve timer implementation and ensure that no fd leak happensJens Lorenz2018-04-091-47/+47
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Rework of listenToSignal and minor improvementsJens Lorenz2018-04-091-17/+15
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* AMUtil: Improve actionPoll lambda implementation for signal and timerJens Lorenz2018-04-091-27/+45
| | | | Signed-off-by: Jens Lorenz <jlorenz@de.adit-jv.com>
* Revert "Utility updates capi fixes"revert-26-utilityUpdates_CAPI_fixesJens Lorenz2018-03-131-201/+114
|
* Remainning fixes from utility updateutilityUpdates_CAPI_fixesDon Al2018-02-271-50/+61
| | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I3c8a2b474bc8fac62c76a46545a231c718edb2a9
* The real-time scheduler removed.Aleksandar Donchev2018-02-131-13/+0
| | | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I7c8a2c474bc8fac62c76a46545a231c518edb2a8
* Cmake parameters for real-time scheduler's priority and policy and throw ↵Aleksandar Donchev2018-02-131-8/+27
| | | | | | | | runtime error if read fails. Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I6a7a2c424bc8fac62c76a66545a231c518edb2e1
* Real time scheduler added, capi wrapper timeout return value considered in ↵Aleksandar Donchev2018-02-131-31/+20
| | | | | | | registerTimeout, only requested revent passed from within the camsockethandler instead of all Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I2d9d2c424ac3fac62c76a66545a531c518edb2e8
* * All methods in CAPI wrapper with connectionID parameter are deprecated ↵Aleksandar Donchev2018-02-131-23/+25
| | | | | | | | | | | because CommonAPI creates new filedescriptor per connection which isn't needed. * revents flag is passed to the CommonAPI watcher instead events * revents set to 0 in Sockethandler Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I9d9d2c424ac9fad62c76a66545c731c518adb2e4
* Runtime check for calls to the sockethandler from other threadsAleksandar Donchev2018-02-131-1/+32
| | | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I9d9d3c424ac9fad62c76a76545c731b518bdb1e2
* A filedescriptor removal will set an invalidation flag which will prevent ↵Aleksandar Donchev2018-02-131-37/+48
| | | | | | | | | | | calls on the invalidated objects in the current iteration. Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I9d5d3c434ac9fad62c76a76145c731b538aeb1e3 # Conflicts: # AudioManagerUtilities/src/CAmSocketHandler.cpp
* Timer fd is closed at the beginning of the next iteration + some unit tests. ↵Aleksandar Donchev2018-02-131-33/+70
| | | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8c5d3c436ac9fad62c76a26145c731b538abb1e7
* AMUtil: fix missed copy in list PollGuerra Mattia2017-09-291-13/+18
| | | | | | | | | When copying the list of Poll fd, also the revents have to be copied. This is very important for AM Plugins which rely on revents in order to consume data. Without updating the revents, there's concrete risk of endless poll and general stuck situation. Signed-off-by: Guerra Mattia <mguerra@de.adit-jv.com>
* The primary signals SIGINT and SIGQUIT are handled on top level inAleksandar Donchev2017-07-101-793/+834
| | | | | | | | | contrast to secondary signals SIGHUP, SIGTERM, SIGCHLD, which are handled in the SocketHandler. Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8c5d3c436ac9fcd61c76a26145c731b427cab1e6
* Fix for bug in CAmSocketHandler causing invalid pointers and crash.Aleksandar Donchev2017-05-021-35/+40
| | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8d3d2b436ac9fcd61c73a28145a731f327cab1e2
* Signal handling via main loop with signalfd.Aleksandar Donchev2017-05-021-47/+166
| | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8c4c2c436ac9fcd61c76a21145c731f327cab0c1
* CAmSerializer interface extended to support std::function. Aleksandar Donchev2017-05-021-57/+61
| | | | | Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8b4c2c436ac9fbc37c76a21145c731f327cab0e4
* CAmSocketHandler - usage of std::function instead of function pointers,Aleksandar Donchev2017-05-021-120/+204
| | | | | | | code cleanup and minior optimizations. Signed-off-by: Christian Linke <christian.linke@bmw.de> Change-Id: I8c2c2c436ac9abc37c76a12245c731f327cab0e5
* Linux specific TIMERFD implementation as alternative timer mechanismAleksandar Donchev2017-05-021-497/+675
| | | | Signed-off-by: Christian Linke <christian.linke@bmw.de>
* try catch for sockethandler callbacksChristian Linke2016-05-181-2/+64
| | | | | small improvements of sockethandler. Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* close pipes after useChristian Linke2016-05-171-0/+2
| | | | | Signed-off-by: Christian Linke <Christian.Linke@bmw.de> Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* enable deleting of CommandLineSingletonChristian Linke2016-04-201-1/+1
| | | | | fix log message Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* make sure that handles are never 0Christian Linke2016-04-111-2/+2
| | | Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* Forgot the handleChristian Linke2016-02-171-2/+2
| | | | Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* Added overflow handling for timer and poll handlesChristian Linke2016-02-161-3/+41
| | | | Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* * rework of the build structure, adopt to standard cmake package structure7.4Christian Linke2016-02-151-2/+1
| | | | | | | | | | | | | | * check versions when loading the libs * introduction of the AudioManagerCore * give control plugin as file or directory * remove SQLITE * either find and use gmock or build and install it * fixed [Bug 411] * compile flag gnu11 is now used Signed-off-by: Christian Linke <Christian.Linke@bmw.de> Signed-off-by: Christian Linke <Christian.Linke@bmw.de>
* * remove warningChristian Linke2015-09-111-1/+1
|
* * install tclap headers7.1Christian Linke2015-09-021-1/+1
| | | * rename config.h into audiomanagerconfig.h
* * Updated license fileChristian Linke2015-04-281-0/+2
| | | | | | * Added authors file * Adopted to spdx header file Signed-off-by: Christian Linke <christian.linke@bmw.de>
* * fully rework. Plugins have now a new own git repositoryChristian Linke2015-03-121-0/+546
* building out of source of plugins without AM workss * build system cmake contructions is different now Signed-off-by: Christian Linke <christian.linke@bmw.de>