Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Announce] Yappari - A WhatsApp Client for the N900 ONLY

    Closed Thread
    Page 441 of 542 | Prev | 431   439     440   441   442     443   451 | Next | Last
    murik | # 4401 | 2013-10-21, 17:27 | Report

    Originally Posted by Scorpius View Post
    You've got to be kidding me...

    You have to run Yappari 24/7 to receive messages all the time. You can close the main window but Yappari has to be running (you have to see the blue icon in the notification area) if you want to receive messages.

    What did you EXPECT?!?!?!?
    seems like he want to run yappari like whatsapp, always hided and working when message received )

    Edit | Forward | Quote | Quick Reply | Thanks

     
    shivam_dhiman | # 4402 | 2013-10-21, 18:09 | Report

    Originally Posted by murik View Post
    seems like he want to run yappari like whatsapp, always hided and working when message received )
    yaa i want this only.....

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Tschaka | # 4403 | 2013-10-21, 18:32 | Report

    Originally Posted by shivam_dhiman View Post
    yaa i want this only.....
    Then don't quit the application. What's the deal with that?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Ast007 | # 4404 | 2013-10-23, 13:14 | Report

    @Scorpius

    Hi there,

    I remember you saying you will be working on bbm once its released. Are you still going to work on it?

    thx

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Scorpius | # 4405 | 2013-10-23, 13:18 | Report

    Originally Posted by Ast007 View Post
    @Scorpius

    Hi there,

    I remember you saying you will be working on bbm once its released. Are you still going to work on it?

    thx
    I'm not sure, I don't think I have that much free time in my hands lately.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    NerdKnight | # 4406 | 2013-10-25, 03:04 | Report

    Hi Scorpius, I think I found the problem causing Yappari to consume too much CPU, the problem is located here:
    Code:
    void BinTreeNodeReader::fillArray(QByteArray& buffer, quint32 len)
    {
    Utilities::logData("Debug: BinTreeNodeReader::fillArray");
        char data[1025];
    
        buffer.clear();
    
        // bool ready = true;
    
        /*
        if (socket->bytesAvailable() < 1)
        {
            Utilities::logData("fillArray() waiting for bytes");
            ready = socket->waitForReadyRead(READ_TIMEOUT);
        }
    
        if (!ready)
        {
            Utilities::logData("fillArray() not ready / timed out");
            throw IOException(socket->error());
        }
        */
    
        int needToRead = len;
        while (needToRead > 0)
        {
            Utilities::logData("Debug: BinTreeNodeReader::fillArray--loop");
            int bytesRead = socket->read(data,(needToRead > 1024) ? 1024 : needToRead);
    
            if (bytesRead < 0)
                throw IOException(socket->error());
            if (bytesRead == 0)
                // socket->waitForReadyRead(READ_TIMEOUT);
                qApp->processEvents();
            else
            {
                needToRead -= bytesRead;
                buffer.append(data,bytesRead);
            }
        }
    }
    It looks like when there is some sort of connection problem, it nevers exists the while loop and there is no sleep function called, so Yappri eats the CPU. As you can see I added some log messages, when the problem arouse, in minutes the log file grew 26MB large, until I ran out of disk space. I'll patch the code and see if it happens again.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Scorpius | # 4407 | 2013-10-25, 03:23 | Report

    Originally Posted by NerdKnight View Post
    It looks like when there is some sort of connection problem, it nevers exists the while loop and there is no sleep function called, so Yappri eats the CPU. As you can see I added some log messages, when the problem arouse, in minutes the log file grew 26MB large, until I ran out of disk space. I'll patch the code and see if it happens again.
    You can try to uncomment the waitForReadyRead but put it AFTER the processEvents.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    NerdKnight | # 4408 | 2013-10-25, 03:34 | Report

    Originally Posted by Scorpius View Post
    You can try to uncomment the waitForReadyRead but put it AFTER the processEvents.
    Ok, I'll try it and let you know what happens.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    sicelo | # 4409 | 2013-10-25, 18:42 | Report

    Originally Posted by NerdKnight View Post
    Hi Scorpius, I think I found the problem causing Yappari to consume too much CPU, the problem is located here:
    Code:
    void BinTreeNodeReader::fillArray(QByteArray& buffer, quint32 len)
    {
    Utilities::logData("Debug: BinTreeNodeReader::fillArray");
        char data[1025];
    
        buffer.clear();
    
        // bool ready = true;
    
        /*
        if (socket->bytesAvailable() < 1)
        {
            Utilities::logData("fillArray() waiting for bytes");
            ready = socket->waitForReadyRead(READ_TIMEOUT);
        }
    
        if (!ready)
        {
            Utilities::logData("fillArray() not ready / timed out");
            throw IOException(socket->error());
        }
        */
    
        int needToRead = len;
        while (needToRead > 0)
        {
            Utilities::logData("Debug: BinTreeNodeReader::fillArray--loop");
            int bytesRead = socket->read(data,(needToRead > 1024) ? 1024 : needToRead);
    
            if (bytesRead < 0)
                throw IOException(socket->error());
            if (bytesRead == 0)
                // socket->waitForReadyRead(READ_TIMEOUT);
                qApp->processEvents();
            else
            {
                needToRead -= bytesRead;
                buffer.append(data,bytesRead);
            }
        }
    }
    Maybe I missed something, where did you get this code?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Scorpius | # 4410 | 2013-10-25, 18:53 | Report

    Originally Posted by NerdKnight View Post
    Ok, I'll try it and let you know what happens.
    The problem and the reason waitForReadyRead is commented out is because it is a blocking function and the whole GUI hangs until a byte is received, and that's a big problem.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 441 of 542 | Prev | 431   439     440   441   442     443   451 | Next | Last
vBulletin® Version 3.8.8
Normal Logout