27 #include "xqserviceipcobserver.h" |
27 #include "xqserviceipcobserver.h" |
28 |
28 |
29 namespace QtService |
29 namespace QtService |
30 { |
30 { |
31 /*! |
31 /*! |
32 \class ServiceFwIPCServer |
32 \class ServiceFwIPCServer |
33 Service Framework IPC Server public class |
33 \brief Service Framework IPC Server public class |
34 */ |
34 */ |
35 |
35 |
36 /*! |
36 /*! |
37 Constructor |
37 Constructor. |
38 @param aBackend backend to instantiate |
38 \param aObserver Engine observer to call back to handle new requests. |
39 @param aObserver engine observer to call back to handle new requests |
39 \param aParent QObject's parent. |
40 @param aParent QObject's parent |
40 \param aBackend Backend to instantiate. |
41 */ |
41 */ |
42 ServiceFwIPCServer::ServiceFwIPCServer( MServiceIPCObserver* aObserver, |
42 ServiceFwIPCServer::ServiceFwIPCServer( MServiceIPCObserver* aObserver, |
43 QObject* aParent, |
43 QObject* aParent, |
44 TServiceIPCBackends aBackend ) : |
44 TServiceIPCBackends aBackend ) : |
45 QObject(aParent ), |
45 QObject(aParent ), |
50 d = ServiceFwIPCServerFactory::createBackend( aParent,aBackend ); |
50 d = ServiceFwIPCServerFactory::createBackend( aParent,aBackend ); |
51 d->q = this; |
51 d->q = this; |
52 } |
52 } |
53 |
53 |
54 /*! |
54 /*! |
55 Destructor |
55 Destructor. |
56 */ |
56 */ |
57 ServiceFwIPCServer::~ServiceFwIPCServer() |
57 ServiceFwIPCServer::~ServiceFwIPCServer() |
58 { |
58 { |
59 XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::~ServiceFwIPCServer"); |
59 XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::~ServiceFwIPCServer"); |
60 delete d; |
60 delete d; |
61 } |
61 } |
62 |
62 |
63 /*! |
63 /*! |
64 Start listening for new service requests |
64 Start listening for new service requests. |
65 @param aServerName name of the server |
65 \param aServerName Name of the server. |
66 @return bool if connected |
66 \return true if connected. |
67 */ |
67 */ |
68 bool ServiceFwIPCServer::listen(const QString& aServerName) |
68 bool ServiceFwIPCServer::listen(const QString& aServerName) |
69 { |
69 { |
70 XQSERVICE_DEBUG_PRINT("aServerName: %s", qPrintable(aServerName)); |
70 XQSERVICE_DEBUG_PRINT("aServerName: %s", qPrintable(aServerName)); |
71 XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::listen"); |
71 XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::listen"); |
72 return d->listen(aServerName); |
72 return d->listen(aServerName); |
73 } |
73 } |
74 |
74 |
75 /*! |
75 /*! |
76 Shutdown the server and stop serving clients |
76 Shutdown the server and stop serving clients. |
77 @return void |
77 */ |
78 */ |
|
79 void ServiceFwIPCServer::disconnect() |
78 void ServiceFwIPCServer::disconnect() |
80 { |
79 { |
81 XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::disconnect"); |
80 XQSERVICE_DEBUG_PRINT("ServiceFwIPCServer::disconnect"); |
82 d->disconnect(); |
81 d->disconnect(); |
83 } |
82 } |