PDA

View Full Version : Socket buffer fill



navi1084
31st August 2009, 11:51
Hi,
My application connect to a external device which continuously sending data. This works fine in main window. If i open a popup window like FileOpen or FileSave or other custom popup window and try to move these windows, my external device stop sending the data. can anyone tell why it is like this. This behavior also exist, when i click minimize/colse button without releasing it.
Precondition is: external device continuously sends large amount of data.

Can anyone tell, how can i resolve this so that my external device doesnt stop even on user interaction on popup window?

Thank you in advance

wysota
31st August 2009, 12:01
You can increase the buffer size of the receiving side or the sending buffer on the sending side.

navi1084
31st August 2009, 12:17
Thank you for the reply.
Can you tell me how can increase the buffer size.?
And even if i increase the buffer size, and user hold the minimize/maximize button for long time then same problem occure. Is there any other alternative solution.

wysota
31st August 2009, 12:25
Can you tell me how can increase the buffer size.?
This is OS dependent as you need to do that on TCP level.


And even if i increase the buffer size, and user hold the minimize/maximize button for long time then same problem occure.

Is there any other alternative solution.

The ultimate solution is to use an operating system that doesn't block events when the window is dragged :)

Apart from that you shouldn't use QDialog::exec() as it doesn't pass network traffic through. You should instead use QEventLoop and QDialog::setModal(). But of course you won't be able to use the native file dialog then...

In my opinion you should just handle such situation in the application streaming data. The situation you described is not the only one where the TCP flow control kicks in and blocks the sender.