summaryrefslogtreecommitdiff
path: root/sapconnectionrequest.cc
blob: 4842ff6d79d27995263a9561833b413213163b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "sappeer.h"
#include "sapconnection.h"
#include "sapconnectionrequest.h"

SAPConnectionRequest::SAPConnectionRequest(SAPConnection *conn, int initiatorId, int acceptorId)
    : _conn(conn), _initiator(initiatorId), _acceptor(acceptorId)
{
}

SAPConnection *SAPConnectionRequest::connection()
{
	return _conn;
}

SAPPeer * SAPConnectionRequest::peer()
{
	return connection()->peer();
}

void SAPConnectionRequest::accept()
{
	peer()->acceptServiceConnection(this, 0);
	delete this;
}

void SAPConnectionRequest::reject(int reason)
{
	peer()->acceptServiceConnection(this, reason);
	delete this;
}

int SAPConnectionRequest::initiatorId() const
{
	return _initiator;
}

int SAPConnectionRequest::acceptorId() const
{
	return _acceptor;
}