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
This commit is contained in:
parent
86469b8c91
commit
c73fb70eb7
|
@ -21,7 +21,7 @@
|
|||
//
|
||||
// File Name: PortLink.h
|
||||
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
||||
// 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 <BeBuild.h>
|
||||
#include <OS.h>
|
||||
#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;
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include <Point.h>
|
||||
#include <ServerProtocol.h>
|
||||
|
||||
#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:
|
||||
|
|
Loading…
Reference in New Issue