Conversion over to BSession API

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4923 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-10-02 01:01:45 +00:00
parent 2dd8f56272
commit 594cf26a76
3 changed files with 17 additions and 12 deletions

View File

@ -35,7 +35,8 @@
// System Includes ------------------------------------------------------------- // System Includes -------------------------------------------------------------
// Project Includes ------------------------------------------------------------ // Project Includes ------------------------------------------------------------
#include <PortLink.h> #include <Session.h>
#include <OS.h>
// Local Includes -------------------------------------------------------------- // Local Includes --------------------------------------------------------------
@ -47,11 +48,13 @@
namespace BPrivate { namespace BPrivate {
class BAppServerLink : public PortLink class BAppServerLink : public BSession
{ {
public: public:
BAppServerLink(void); BAppServerLink(void);
~BAppServerLink(void); ~BAppServerLink(void);
private:
port_id receiver;
}; };
} // namespace BPrivate } // namespace BPrivate

View File

@ -44,16 +44,19 @@
namespace BPrivate { namespace BPrivate {
BAppServerLink::BAppServerLink(void) BAppServerLink::BAppServerLink(void)
: PortLink(0L) : BSession(0L,0L)
{ {
be_app->Lock(); be_app->Lock();
SetPort(be_app->fServerFrom); receiver=create_port(100,"AppServerLink reply port");
SetSendPort(be_app->fServerFrom);
SetRecvPort(receiver);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BAppServerLink::~BAppServerLink() BAppServerLink::~BAppServerLink()
{ {
delete_port(receiver);
be_app->Unlock(); be_app->Unlock();
} }

View File

@ -62,12 +62,11 @@ BCursor::BCursor(const void *cursorData)
// Send data directly to server // Send data directly to server
BPrivate::BAppServerLink serverlink; BPrivate::BAppServerLink serverlink;
PortMessage pmsg;
serverlink.SetOpCode(AS_CREATE_BCURSOR); serverlink.WriteInt32(AS_CREATE_BCURSOR);
serverlink.Attach((void *)cursorData,68); serverlink.WriteData(cursorData,68);
serverlink.FlushWithReply(&pmsg); serverlink.Sync();
pmsg.Read(&m_serverToken); serverlink.ReadInt32(&m_serverToken);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// undefined on BeOS // undefined on BeOS
@ -80,9 +79,9 @@ BCursor::~BCursor()
{ {
// Notify server to deallocate server-side objects for this cursor // Notify server to deallocate server-side objects for this cursor
BPrivate::BAppServerLink serverlink; BPrivate::BAppServerLink serverlink;
serverlink.SetOpCode(AS_DELETE_BCURSOR); serverlink.WriteInt32(AS_DELETE_BCURSOR);
serverlink.Attach(m_serverToken); serverlink.WriteInt32(m_serverToken);
serverlink.Flush(); serverlink.Sync();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// not implemented on BeOS // not implemented on BeOS