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:
@@ -21,7 +21,7 @@
|
|||||||
//
|
//
|
||||||
// File Name: PortLink.h
|
// File Name: PortLink.h
|
||||||
// Author: DarkWyrm <[email protected]>
|
// Author: DarkWyrm <[email protected]>
|
||||||
// Description: Class for low-overhead port-based messaging
|
// Description: Class for low-overhead packet-style port-based messaging
|
||||||
//
|
//
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
#ifndef _PORTLINK_H
|
#ifndef _PORTLINK_H
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <BeBuild.h>
|
#include <BeBuild.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
#include "Session.h"
|
||||||
|
|
||||||
class PortMessage;
|
class PortMessage;
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ public:
|
|||||||
{
|
{
|
||||||
int32 size = sizeof(Type);
|
int32 size = sizeof(Type);
|
||||||
|
|
||||||
if (4096 - fSendPosition > size){
|
if ( (SESSION_BUFFER_SIZE*4) - fSendPosition > size){
|
||||||
memcpy(fSendBuffer + fSendPosition, &data, size);
|
memcpy(fSendBuffer + fSendPosition, &data, size);
|
||||||
fSendPosition += size;
|
fSendPosition += size;
|
||||||
*fDataSize+=size;
|
*fDataSize+=size;
|
||||||
@@ -65,7 +66,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool port_ok;
|
bool fPortValid;
|
||||||
port_id fSendPort;
|
port_id fSendPort;
|
||||||
port_id fReceivePort;
|
port_id fReceivePort;
|
||||||
char *fSendBuffer;
|
char *fSendBuffer;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
#include <ServerProtocol.h>
|
#include <ServerProtocol.h>
|
||||||
|
|
||||||
|
#define SESSION_BUFFER_SIZE 1024
|
||||||
|
|
||||||
class BSession
|
class BSession
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -89,10 +91,8 @@ public:
|
|||||||
void WriteData(const void* data, int32 size);
|
void WriteData(const void* data, int32 size);
|
||||||
|
|
||||||
void Sync();
|
void Sync();
|
||||||
void Close();
|
|
||||||
|
|
||||||
// if possible, do not use
|
// Deprecated. Do not use.
|
||||||
void SetMsgCode(int32 code);
|
|
||||||
void CopyToSendBuffer(void* buffer, int32 count);
|
void CopyToSendBuffer(void* buffer, int32 count);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user