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: