From c73fb70eb73f498b3363bf949f6466e2aa90a19b Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Fri, 11 Jun 2004 13:36:48 +0000 Subject: [PATCH] Minor header tweaks relating to the message buffer size git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7905 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/PortLink.h | 7 ++++--- headers/private/app/Session.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/headers/private/app/PortLink.h b/headers/private/app/PortLink.h index 42698fa7e0..e3b273f07a 100644 --- a/headers/private/app/PortLink.h +++ b/headers/private/app/PortLink.h @@ -21,7 +21,7 @@ // // File Name: PortLink.h // Author: DarkWyrm -// Description: Class for low-overhead port-based messaging +// Description: Class for low-overhead packet-style port-based messaging // //------------------------------------------------------------------------------ #ifndef _PORTLINK_H @@ -29,6 +29,7 @@ #include #include +#include "Session.h" class PortMessage; @@ -55,7 +56,7 @@ public: { int32 size = sizeof(Type); - if (4096 - fSendPosition > size){ + if ( (SESSION_BUFFER_SIZE*4) - fSendPosition > size){ memcpy(fSendBuffer + fSendPosition, &data, size); fSendPosition += size; *fDataSize+=size; @@ -65,7 +66,7 @@ public: } private: - bool port_ok; + bool fPortValid; port_id fSendPort; port_id fReceivePort; char *fSendBuffer; diff --git a/headers/private/app/Session.h b/headers/private/app/Session.h index 3a543ebc00..1eb7d057e9 100644 --- a/headers/private/app/Session.h +++ b/headers/private/app/Session.h @@ -34,6 +34,8 @@ #include #include +#define SESSION_BUFFER_SIZE 1024 + class BSession { public: @@ -89,10 +91,8 @@ public: void WriteData(const void* data, int32 size); void Sync(); - void Close(); - // if possible, do not use - void SetMsgCode(int32 code); + // Deprecated. Do not use. void CopyToSendBuffer(void* buffer, int32 count); private: