void GSM3MobileClientService::endWrite(bool sync) { flags ^= GSM3MOBILECLIENTSERVICE_WRITING; theGSM3MobileClientProvider->endWriteSocket(); if(sync) waitForAnswer(); }
void TestBindata::remove () { m_client.bindata.remove (m_serverhash) (this, SLOT (cbRemove ())); waitForAnswer (); }
void GSM3MobileClientService::beginWrite(bool sync) { flags |= GSM3MOBILECLIENTSERVICE_WRITING; theGSM3MobileClientProvider->beginWriteSocket(flags & GSM3MOBILECLIENTSERVICE_CLIENT, mySocket); if(sync) waitForAnswer(); }
void TestBindata::retrieve () { m_client.bindata.retrieve (m_serverhash) (this, SLOT (cbRetrieve (QByteArray))); waitForAnswer (); }
void GSM3MobileClientService::flush() { if(flags & GSM3MOBILECLIENTSERVICE_WRITING) endWrite(true); theGSM3MobileClientProvider->flushSocket(/*mySocket*/); if(flags & GSM3MOBILECLIENTSERVICE_SYNCH) waitForAnswer(); }
void GSM3MobileServerService::begin() { if(theGSM3MobileServerProvider==0) return; theGSM3MobileServerProvider->connectTCPServer(_port); if(flags & GSM3MOBILESERVERSERVICE_SYNCH) waitForAnswer(); }
void GSM3MobileClientService::stop() { if(flags & GSM3MOBILECLIENTSERVICE_WRITING) endWrite(true); theGSM3MobileClientProvider->disconnectTCP(flags & GSM3MOBILECLIENTSERVICE_CLIENT, mySocket); theGSM3MobileClientProvider->releaseSocket(mySocket); mySocket = 0; if(flags & GSM3MOBILECLIENTSERVICE_SYNCH) waitForAnswer(); }
void TestBindata::list () { if (XMMS_IPC_PROTOCOL_VERSION < 11) { QSKIP("Bindata list not supported on DrK", SkipSingle); } m_client.bindata.list ()(this, SLOT (cbList (QVariantList)), SLOT(cbFail (QString))); waitForAnswer (); }
void GSM3MobileServerService::stop() { // Review, should be the server? theGSM3MobileClientProvider->disconnectTCP(local1Remote0, mySocket); if(flags & GSM3MOBILESERVERSERVICE_SYNCH) waitForAnswer(); theGSM3MobileClientProvider->releaseSocket(mySocket); mySocket = -1; }
void TestBindata::add () { // usually we should add a Pixmap here QFile f("files/testfile.mp3"); f.open (QIODevice::ReadOnly); m_testdata = f.readAll (); m_client.bindata.add (m_testdata) (this, SLOT (cbAdd (QString))); f.close (); waitForAnswer (); }
int GSM3MobileClientService::available() { int res; // Even if not connected, we are looking for available data if(flags & GSM3MOBILECLIENTSERVICE_WRITING) endWrite(true); res=theGSM3MobileClientProvider->availableSocket(flags & GSM3MOBILECLIENTSERVICE_CLIENT,mySocket); if(flags & GSM3MOBILECLIENTSERVICE_SYNCH) res=waitForAnswer(); return res; }
int GSM3MobileClientService::connect(const char *host, uint16_t port) { if(theGSM3MobileClientProvider==0) return 2; // TODO: ask for the socket id mySocket=theGSM3MobileClientProvider->getSocket(); if(mySocket<0) return 2; int res=theGSM3MobileClientProvider->connectTCPClient(host, port, mySocket); if(flags & GSM3MOBILECLIENTSERVICE_SYNCH) res=waitForAnswer(); return res; }