
|
[haiku-development]
||
[Date Prev]
[09-2007 Date Index]
[Date Next]
||
[Thread Prev]
[09-2007 Thread Index]
[Thread Next]
[haiku-development] Cleaning up libbe - app_server communication
- From: "Michael Lotz" <mmlr@xxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Tue, 4 Sep 2007 19:13:59 +0200
Hi there
I've been checking some of the defined protocols lately. This with the
specific case of ensuring proper GCC2 <-> GCC4 communication, but also in
general to check for possible hidden communication problems.
I have built a small helper construct to debug the libbe <-> app_server
connections using typeid().name() to compare what is written/read as what type
with what size on both ends of the link. (A string is built using the names
and sizes and then attached to the message before sending and checked at the
other end before fetching the next message).
My observations so far are that in general the sizes read and written match.
Also on a first look there don't seem to be obvious type mismatches. But when
taking a closer look it's easy to see that how the client writes and how the
server reads differ greatly from a type standpoint of view.
As an example the simple AS_STROKE_LINE uses Attach<BPoint>(pt0);
Attach<BPoint>(pt1); on the client while the server then reads them as four
Read<float>(x/y). While this is not really a problem as BPoint consists out of
two floats data wise - it still seems very inconsistent to me. Similar things
happen with color values, patterns and so forth.
Then there is the point of using the <someType> syntax with the template
function at all. It's a template function and it will deal with the different
types that you throw at it, so the explicit stating of the type is not
necessary. I can only imagine that using this syntax was done to kinda
"document" the types that are used or expected. Or am I missing something here?
So my questions are now:
1) Should I go on and "sync" the client and server code so they always use the
same types?
2) May I remove the unnecessary explicit type given with the <someType> syntax?
3) Should I check the (kinda hacky) debug mechanism in too (guarded by a debug
define)?
If we officially don't care too much about those exact types used as long as
it works I will only check to ensure that no complete mismatches happens
somewhere. Otherwise I'd start to cleanup and sync the client and server code.
I'd like to hear some opinions first before I start throwing around commits ;-)
Regards
Michael
|

|