Added global app_server port, so that other parts of the server don't have

to search for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12859 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-05-27 13:36:05 +00:00
parent a4ad43aa83
commit 2724858b5b
3 changed files with 43 additions and 44 deletions
+3 -18
View File
@@ -216,12 +216,7 @@ ServerApp::PingTarget(void)
{
team_info tinfo;
if (get_team_info(fClientTeamID,&tinfo) == B_BAD_TEAM_ID) {
port_id serverport = find_port(SERVER_PORT_NAME);
if (serverport == B_NAME_NOT_FOUND) {
printf("PANIC: ServerApp %s could not find the app_server port in PingTarget()!\n",fSignature.String());
return false;
}
fMsgSender->SetPort(serverport);
fMsgSender->SetPort(gAppServerPort);
fMsgSender->StartMessage(AS_DELETE_APP);
fMsgSender->Attach(&fMonitorThreadID, sizeof(thread_id));
fMsgSender->Flush();
@@ -308,12 +303,7 @@ ServerApp::MonitorApp(void *data)
STRACE(("ServerApp::MonitorApp(): GetNextMessage returned %s\n", strerror(err)));
// ToDo: this should kill the app, but it doesn't work
port_id serverport = find_port(SERVER_PORT_NAME);
if (serverport == B_NAME_NOT_FOUND){
printf("PANIC: ServerApp %s could not find the app_server port!\n",app->fSignature.String());
break;
}
app->fMsgSender->SetPort(serverport);
app->fMsgSender->SetPort(gAppServerPort);
app->fMsgSender->StartMessage(AS_DELETE_APP);
app->fMsgSender->Attach(&app->fMonitorThreadID, sizeof(thread_id));
app->fMsgSender->Flush();
@@ -393,12 +383,7 @@ ServerApp::MonitorApp(void *data)
STRACE(("ServerApp %s: B_QUIT_REQUESTED\n",app->fSignature.String()));
// Our BApplication sent us this message when it quit.
// We need to ask the app_server to delete ourself.
port_id serverport = find_port(SERVER_PORT_NAME);
if (serverport == B_NAME_NOT_FOUND){
printf("PANIC: ServerApp %s could not find the app_server port!\n",app->fSignature.String());
break;
}
app->fMsgSender->SetPort(serverport);
app->fMsgSender->SetPort(gAppServerPort);
app->fMsgSender->StartMessage(AS_DELETE_APP);
app->fMsgSender->Attach(&app->fMonitorThreadID, sizeof(thread_id));
app->fMsgSender->Flush();