using namespace Tizen::Io;
using namespace Tizen::App;
-static void
-ConvertBundleToMap(const char *pKey, const int type, const bundle_keyval_t *pVal, void *pData)
-{
- SysLog(NID_IO, "CB key = %s", pKey);
-
-}
-
_MessagePortStub::_MessagePortStub(void)
: __pIpcServer(null)
, __pService(null)
_MessagePortStub::~_MessagePortStub(void)
{
- delete __pIpcServer;
+ if (__pIpcServer != null)
+ {
+ __pIpcServer->Stop();
+ delete __pIpcServer;
+ }
}
result
}
bool
-_MessagePortStub::OnSendMessage(const BundleBuffer& buffer, int* pResult)
+_MessagePortStub::OnSendMessage(const BundleBuffer& metadata, const BundleBuffer& buffer, int* pResult)
{
SysAssertf(__pService != null, "MessagePort service has not been initialized.\n");
- *pResult = __pService->SendMessage(buffer);
+ *pResult = __pService->SendMessage(metadata, buffer);
+ bundle_free(metadata.b);
bundle_free(buffer.b);
return true;
}
result
-_MessagePortStub::SendMessage(int clientId, const BundleBuffer& buffer)
+_MessagePortStub::SendMessage(int clientId, const BundleBuffer& metadata, const BundleBuffer& buffer)
{
SysAssertf(__pService != null, "MessagePort service has not been initialized.\n");
- result r = __pIpcServer->SendResponse(clientId, new MessagePort_sendMessageAsync(buffer));
+ result r = __pIpcServer->SendResponse(clientId, new MessagePort_sendMessageAsync(metadata, buffer));
SysTryReturnResult(NID_IO, r == E_SUCCESS, r, "Failed to send a response message.");