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:
parent
2dd8f56272
commit
594cf26a76
@ -35,7 +35,8 @@
|
||||
// System Includes -------------------------------------------------------------
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
#include <PortLink.h>
|
||||
#include <Session.h>
|
||||
#include <OS.h>
|
||||
|
||||
// Local Includes --------------------------------------------------------------
|
||||
|
||||
@ -47,11 +48,13 @@
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
class BAppServerLink : public PortLink
|
||||
class BAppServerLink : public BSession
|
||||
{
|
||||
public:
|
||||
BAppServerLink(void);
|
||||
~BAppServerLink(void);
|
||||
private:
|
||||
port_id receiver;
|
||||
};
|
||||
|
||||
} // namespace BPrivate
|
||||
|
@ -44,16 +44,19 @@
|
||||
namespace BPrivate {
|
||||
|
||||
BAppServerLink::BAppServerLink(void)
|
||||
: PortLink(0L)
|
||||
: BSession(0L,0L)
|
||||
{
|
||||
be_app->Lock();
|
||||
SetPort(be_app->fServerFrom);
|
||||
receiver=create_port(100,"AppServerLink reply port");
|
||||
SetSendPort(be_app->fServerFrom);
|
||||
SetRecvPort(receiver);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
BAppServerLink::~BAppServerLink()
|
||||
{
|
||||
delete_port(receiver);
|
||||
be_app->Unlock();
|
||||
}
|
||||
|
||||
|
@ -62,12 +62,11 @@ BCursor::BCursor(const void *cursorData)
|
||||
|
||||
// Send data directly to server
|
||||
BPrivate::BAppServerLink serverlink;
|
||||
PortMessage pmsg;
|
||||
|
||||
serverlink.SetOpCode(AS_CREATE_BCURSOR);
|
||||
serverlink.Attach((void *)cursorData,68);
|
||||
serverlink.FlushWithReply(&pmsg);
|
||||
pmsg.Read(&m_serverToken);
|
||||
serverlink.WriteInt32(AS_CREATE_BCURSOR);
|
||||
serverlink.WriteData(cursorData,68);
|
||||
serverlink.Sync();
|
||||
serverlink.ReadInt32(&m_serverToken);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// undefined on BeOS
|
||||
@ -80,9 +79,9 @@ BCursor::~BCursor()
|
||||
{
|
||||
// Notify server to deallocate server-side objects for this cursor
|
||||
BPrivate::BAppServerLink serverlink;
|
||||
serverlink.SetOpCode(AS_DELETE_BCURSOR);
|
||||
serverlink.Attach(m_serverToken);
|
||||
serverlink.Flush();
|
||||
serverlink.WriteInt32(AS_DELETE_BCURSOR);
|
||||
serverlink.WriteInt32(m_serverToken);
|
||||
serverlink.Sync();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// not implemented on BeOS
|
||||
|
Loading…
Reference in New Issue
Block a user