Tweaked all messaging classes to comply with new message protocol policies

AppServerLink no longer inherits from BSession


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4941 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-10-04 19:06:34 +00:00
parent e90ddf96b4
commit 7507620c3a
5 changed files with 34 additions and 12 deletions

View File

@ -37,6 +37,7 @@
// Project Includes ------------------------------------------------------------
#include <Session.h>
#include <OS.h>
#include <PortLink.h>
// Local Includes --------------------------------------------------------------
@ -44,11 +45,10 @@
// Globals ---------------------------------------------------------------------
//class PortLink;
namespace BPrivate {
class BAppServerLink : public BSession
class BAppServerLink : public PortLink
{
public:
BAppServerLink(void);

View File

@ -1,3 +1,29 @@
//------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: PortLink.h
// Author: DarkWyrm <bpmagic@columbus.rr.com>
// Description: Class for low-overhead port-based messaging
//
//------------------------------------------------------------------------------
#ifndef _PORTLINK_H
#define _PORTLINK_H

View File

@ -69,13 +69,11 @@ public:
}
void Rewind(void);
void BSessionWorkaround(void);
private:
int32 _code;
uint8 *_buffer;
ssize_t _buffersize;
uint8 *_index;
bool is_session_msg;
};
#endif

View File

@ -13,7 +13,7 @@ enum
SERVER_TRUE='_srt',
SERVER_FALSE,
AS_SERVER_BMESSAGE,
AS_SERVER_SESSION,
AS_SERVER_AREALINK,
// Application definitions
AS_CREATE_APP,

View File

@ -11,16 +11,16 @@
class BSession {
public:
BSession(port_id receivePort, port_id sendPort, bool isPortLink = false);
BSession(int32, char *);
BSession( const BSession &ses );
virtual ~BSession();
BSession(port_id receivePort, port_id sendPort, bool isPortLink = false);
BSession(int32, char *);
BSession( const BSession &ses );
virtual ~BSession();
void SetSendPort( port_id port );
void SetRecvPort( port_id port );
port_id GetSendPort(void) const { return fSendPort; }
port_id GetRecvPort(void) const { return fReceivePort; }
bool DropInputBuffer();
void SetMsgCode(int32 code);
char* ReadString();
status_t ReadBool( bool *b );
status_t ReadInt8( int8 *i );
@ -66,7 +66,6 @@ virtual ~BSession();
status_t Sync();
void Close();
private:
friend class PortLink;
port_id fSendPort;
port_id fReceivePort;
@ -80,6 +79,5 @@ friend class PortLink;
int32 fReceivePosition;
};
//extern _IMPEXP_BE _BSession_ *main_session;
#endif