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:
@@ -37,6 +37,7 @@
|
|||||||
// Project Includes ------------------------------------------------------------
|
// Project Includes ------------------------------------------------------------
|
||||||
#include <Session.h>
|
#include <Session.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
#include <PortLink.h>
|
||||||
|
|
||||||
// Local Includes --------------------------------------------------------------
|
// Local Includes --------------------------------------------------------------
|
||||||
|
|
||||||
@@ -44,11 +45,10 @@
|
|||||||
|
|
||||||
// Globals ---------------------------------------------------------------------
|
// Globals ---------------------------------------------------------------------
|
||||||
|
|
||||||
//class PortLink;
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
class BAppServerLink : public BSession
|
class BAppServerLink : public PortLink
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BAppServerLink(void);
|
BAppServerLink(void);
|
||||||
|
|||||||
@@ -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 <[email protected]>
|
||||||
|
// Description: Class for low-overhead port-based messaging
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
#ifndef _PORTLINK_H
|
#ifndef _PORTLINK_H
|
||||||
#define _PORTLINK_H
|
#define _PORTLINK_H
|
||||||
|
|
||||||
|
|||||||
@@ -69,13 +69,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Rewind(void);
|
void Rewind(void);
|
||||||
void BSessionWorkaround(void);
|
|
||||||
private:
|
private:
|
||||||
int32 _code;
|
int32 _code;
|
||||||
uint8 *_buffer;
|
uint8 *_buffer;
|
||||||
ssize_t _buffersize;
|
ssize_t _buffersize;
|
||||||
uint8 *_index;
|
uint8 *_index;
|
||||||
bool is_session_msg;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ enum
|
|||||||
SERVER_TRUE='_srt',
|
SERVER_TRUE='_srt',
|
||||||
SERVER_FALSE,
|
SERVER_FALSE,
|
||||||
AS_SERVER_BMESSAGE,
|
AS_SERVER_BMESSAGE,
|
||||||
AS_SERVER_SESSION,
|
AS_SERVER_AREALINK,
|
||||||
|
|
||||||
// Application definitions
|
// Application definitions
|
||||||
AS_CREATE_APP,
|
AS_CREATE_APP,
|
||||||
|
|||||||
@@ -11,16 +11,16 @@
|
|||||||
class BSession {
|
class BSession {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BSession(port_id receivePort, port_id sendPort, bool isPortLink = false);
|
BSession(port_id receivePort, port_id sendPort, bool isPortLink = false);
|
||||||
BSession(int32, char *);
|
BSession(int32, char *);
|
||||||
BSession( const BSession &ses );
|
BSession( const BSession &ses );
|
||||||
virtual ~BSession();
|
virtual ~BSession();
|
||||||
void SetSendPort( port_id port );
|
void SetSendPort( port_id port );
|
||||||
void SetRecvPort( port_id port );
|
void SetRecvPort( port_id port );
|
||||||
port_id GetSendPort(void) const { return fSendPort; }
|
port_id GetSendPort(void) const { return fSendPort; }
|
||||||
port_id GetRecvPort(void) const { return fReceivePort; }
|
port_id GetRecvPort(void) const { return fReceivePort; }
|
||||||
bool DropInputBuffer();
|
bool DropInputBuffer();
|
||||||
|
void SetMsgCode(int32 code);
|
||||||
char* ReadString();
|
char* ReadString();
|
||||||
status_t ReadBool( bool *b );
|
status_t ReadBool( bool *b );
|
||||||
status_t ReadInt8( int8 *i );
|
status_t ReadInt8( int8 *i );
|
||||||
@@ -66,7 +66,6 @@ virtual ~BSession();
|
|||||||
status_t Sync();
|
status_t Sync();
|
||||||
void Close();
|
void Close();
|
||||||
private:
|
private:
|
||||||
friend class PortLink;
|
|
||||||
|
|
||||||
port_id fSendPort;
|
port_id fSendPort;
|
||||||
port_id fReceivePort;
|
port_id fReceivePort;
|
||||||
@@ -80,6 +79,5 @@ friend class PortLink;
|
|||||||
int32 fReceivePosition;
|
int32 fReceivePosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
//extern _IMPEXP_BE _BSession_ *main_session;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user