{
int pid;
bool reverse; // true if the connection is for reverse message
- char pkgId[256];
- char appExecutableName[256];
+ char appId[256];
};
gboolean
SysTryCatch(NID_IO, client != -1, , E_SYSTEM, "[E_SYSTEM] Accept failed.");
read(client, &helloMessage, sizeof(helloMessage));
- helloMessage.pkgId[255] = '\0';
- helloMessage.appExecutableName[255] = '\0';
+ helloMessage.appId[255] = '\0';
pChannel = g_io_channel_unix_new(client);
SysTryCatch(NID_IO, pChannel != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Not enough memory.");
pClientInfo->pIpcServer = pIpcServer;
pClientInfo->clientId = helloMessage.pid;
- pClientInfo->pkgId.Append((wchar_t*) helloMessage.pkgId);
- pClientInfo->appExecutableName.Append((wchar_t*) helloMessage.appExecutableName);
+ pClientInfo->appId.Append((wchar_t*) helloMessage.appId);
pClientInfo->pReverseChannel = null;
pIpcServer->__clients[helloMessage.pid] = pClientInfo;
if (__pCurrentClientInfo)
{
- return __pCurrentClientInfo->pkgId;
+ String pkgId;
+ __pCurrentClientInfo->appId.SubString(0, 10, pkgId);
+
+ return pkgId;
}
return nullString;
if (__pCurrentClientInfo)
{
- String appId(__pCurrentClientInfo->pkgId);
- appId.Append(L'.');
- appId.Append(__pCurrentClientInfo->appExecutableName);
-
- return appId;
+ return __pCurrentClientInfo->appId;
}
return nullString;