added a timeout for sending messages down to the client, it keeps app_server from hanging, though of course it doesn't fix the real problem, I have not had time to investigate the messaging, but this work around shows that the hang ups that I was seeing indeed happen in the messaging code

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12557 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-05-03 21:42:37 +00:00
parent 48c0335055
commit 265db80516

View File

@ -2209,19 +2209,21 @@ ServerWindow::_CopyBits(RootLayer* rootLayer, Layer* layer,
//------------------------------------------------------------------------------
void ServerWindow::SendMessageToClient(const BMessage* msg, int32 target, bool usePreferred) const
{
ssize_t size;
char *buffer;
ssize_t size = msg->FlattenedSize();
char* buffer = new char[size];
size = msg->FlattenedSize();
buffer = new char[size];
if (msg->Flatten(buffer, size) == B_OK) {
// BMessage::Private::SendFlattenedMessage(buffer, size,
// fClientLooperPort, target, usePreferred, B_INFINITE_TIMEOUT);
status_t ret = BMessage::Private::SendFlattenedMessage(buffer, size,
fClientLooperPort, target, usePreferred, 100000);
if (ret < B_OK)
fprintf(stderr, "ServerWindow::SendMessageToClient(): %s\n", strerror(ret));
if (msg->Flatten(buffer, size) == B_OK)
BMessage::Private::SendFlattenedMessage(buffer, size,
fClientLooperPort, target, usePreferred, B_INFINITE_TIMEOUT);
else
} else
printf("PANIC: ServerWindow %s: can't flatten message in 'SendMessageToClient()'\n", fName);
delete [] buffer;
delete[] buffer;
}
//------------------------------------------------------------------------------