05-09-2012 02:26 PM
My application sends and receives continuous data over a socket connection (deviceside = true).
I write about 500 to 2000 bytes to the output stream and flush it after the write operation.
Normally the data are sent immediately to the receiver (a windows based application), but with a Torch 9860 (OS 7) I have an issue.
On this device sometimes sending data slows down and stops.
In my application all looks good, the write and flush call returns immediatly without an exception.
The data are not lost but were buffered somewhere, I suppose in the tcp stack of the device.
When I open a website in the browser all the buffered data are send to the receiver.
Without opening the browser I have observed that several minutes no data are sent.
The strange thing is that this does not happen in all environments.
I have tested the same application on the Torch 9860 in several WLAN environments, in most of them it works as expected.
I have no idea what triggers this behaivour in the bad environment.
I've played around a bit with the settings for the send buffer size, with smaller values for the buffer size it looks better.
Hopefully someone can answer me the following questions.
Where are the data buffered?
In the tcp stack or in the send buffer I can configure for my connection?
Why does opening a browser send the buffered data?
How can I force this in my application?
I think flush should do the job, it does it in most of the enviroments.
Why does this only happen only in one of my tested WLAN environments?
What can be the network configuration settings that triggers this behaivour?
05-10-2012 01:52 AM
I forget to mention that the Nagel's algorithm is disabled.
But I think the Nagel's algorithm is not a explanation for the behaviour, this algorithm does not buffer for several minutes.
05-12-2012 02:51 PM
I was wrong that decreasing the send the buffer size of the connection improves the situation, but I have noticed that writing faster to the socket improves it.
In the original code I wrote about every 300ms to the socket. I have decreased this value to 100ms and it seems that no data are buffered any longer.
But this is only a workaround, I would like to understand what happens.
I have also found that the behaviour occurs with several OS 7 devices but not with OS 6 devices in the same environment.
Exists a tool like wireshark for blackberry?
In the bad environment I can check network traffic only on the device.
05-12-2012 04:46 PM
If you want to get to the bottom of this, invest in one of this device.