HostedCall::HostedCall(ClientWorker &worker, QObject *parent) : QObject(parent), _worker(worker) { this->_stopping = false; this->_stopMutex = new myMutex(); connect(&this->_tcpServer, SIGNAL(newConnection()), this, SLOT(receiveNewTcpConnection())); connect(&this->_tcpServer, SIGNAL(acceptError(QAbstractSocket::SocketError)), this, SLOT(onAcceptError(QAbstractSocket::SocketError))); connect(&this->_udpServer, SIGNAL(readyRead()), this, SLOT(receiveUdp())); this->_sManager = new PortAudioSoundManager(this->_container, this); }
/* Start the UDP Servers */ void *udp(void *argc) { int idx = *((int *) argc); while (fileSize == 0); /* sanity to do the file size Split */ splitSize = ceil((double)(fileSize / SPLITS)); numPackets = ceil((double)(splitSize / DGRAM_SIZE)); struct timeval t0,t1; gettimeofday(&t0, 0); receiveUdp(idx); /* lets do the needful now */ gettimeofday(&t1, 0); long elapsed = (t1.tv_sec-t0.tv_sec)*1000000 + t1.tv_usec-t0.tv_usec; printf("Time taken: %ld microseconds\n", elapsed); //printf("Server Idx: %d\n", idx); /* wait for the tcp command to be received */ return 0; }