BAppServerLink is now using BApplication::fServerTo/From for its messaging.

Added LinkMsgReader::NeedsReply() method.
Completely redone ServerApp messaging: no more "replyport" from BAppServerLink; instead,
the registered client reply port is used. Fixed some more weak messaging stuff.
ServerApp now recognizes if an unknown message needs a reply, and sends it - for example,
the "Screen" preferences app no longer hangs, but crashes on start :)
Made LinkMsgReader::Read() virtual again, since it's needed by RAMLinkMsgReader.cpp.
Renamed BPortLink::GetNextReply() to GetNextMessage().
Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13004 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-06-08 04:01:59 +00:00
parent be835bdf0b
commit bd28b3c746
12 changed files with 680 additions and 1033 deletions
+3 -1
View File
@@ -23,7 +23,9 @@ class LinkMsgReader {
port_id Port(void) { return fReceivePort; }
status_t GetNextMessage(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t Read(void *data, ssize_t size);
bool NeedsReply() const;
virtual status_t Read(void *data, ssize_t size);
status_t ReadString(char **string);
template <class Type> status_t Read(Type *data)
{
+11 -2
View File
@@ -61,7 +61,8 @@ class BPortLink {
void SetReplyPort(port_id port);
port_id ReplyPort();
status_t GetNextReply(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t GetNextMessage(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT);
bool NeedsReply() const;
status_t Read(void *data, ssize_t size);
status_t ReadString(char **string);
status_t ReadRegion(BRegion *region);
@@ -71,6 +72,8 @@ class BPortLink {
// convenience methods
status_t FlushWithReply(int32 &code);
LinkMsgReader &Reader() { return *fReader; }
LinkMsgSender &Sender() { return *fSender; }
protected:
LinkMsgReader *fReader;
@@ -148,11 +151,17 @@ BPortLink::ReplyPort()
}
inline status_t
BPortLink::GetNextReply(int32 &code, bigtime_t timeout)
BPortLink::GetNextMessage(int32 &code, bigtime_t timeout)
{
return fReader->GetNextMessage(code, timeout);
}
inline bool
BPortLink::NeedsReply() const
{
return fReader->NeedsReply();
}
inline status_t
BPortLink::Read(void *data, ssize_t size)
{