[Bug] When socket activated the first request might not be
properly handled because all the callback might not have
registered yet.
[Cause] N/A
[Solution] Delayed handling requests until all the callbacks have
been registered.
[Verification] Built, installed, run tests.
Did several tries with triggering socket activation:
1. systemctl start vasum.service
2. vasum-cli create_zone test
3. systemctl stop vasum.service
4. vasum-cli get_zone_ids
5. observe no error and list of zones should show 'test'
6. goto 3
Change-Id: I6de9742959d32afe68f496246065d3befc823955
LOGT("Connecting to host IPC socket");
mService.reset(new ipc::Service(mDispatcher.getPoll(), HOST_IPC_SOCKET));
- LOGT("Starting IPC");
- mService->start();
- LOGD("Connected");
-
using namespace std::placeholders;
setGetZoneIdsCallback(std::bind(&ZonesManager::handleGetZoneIdsCall,
mZonesManagerPtr, _1));
{
}
+void HostIPCConnection::start()
+{
+ LOGT("Starting IPC");
+ mService->start();
+ LOGD("Connected");
+}
+
void HostIPCConnection::setGetZoneIdsCallback(const Method<api::ZoneIds>::type& callback)
{
typedef IPCMethodWrapper<api::ZoneIds> Callback;
HostIPCConnection(ZonesManager* zm);
~HostIPCConnection();
+ void start();
void signalZoneConnectionState(const api::ConnectionState& connectionState);
void sendNotification(const api::Notification& notification);
std::bind(&ZonesManager::switchingSequenceMonitorNotify,
this)));
}
+
+ // After everything's initialized start to respond to clients' requests
+ mHostIPCConnection.start();
}
ZonesManager::~ZonesManager()