Hello,
I have a couple of phones that connect to a tablet using Android sockets / AsyncStreams / Prefix mode.
At the end of the day, after having the tablet instruct each phone to periodically take snapshots, the phones build a zip file containing all the snapshots from the phone and send it to the tablet as binary data in 64K chunks. (The transfer has to be done at the end of the day, not when the snapshots are actually taken).
This zip file can be pretty huge (300 MB). I send the zip file in 64K chunks. I don't want to "saturate" the Wi-Fi connection with this huge transfer.
1) Is there a way on the phone to tell when each chunk has been transferred via Wi-Fi so I can pause a little, letting somebody else jump onto the Wi-Fi if they want, before I try to send the next chunk?
Something like checking for WriteBufferEmpty on the stream then pausing 5 ms before writing the next chunk.
2) Transferring one of the zip files could take a while – maybe 20 minutes. Both phones are connected to the tablet during the transfer. One phone will be sending its zip file and the other phone sitting there doing nothing waiting for a request from the tablet to begin its turn to start sending.
Will an Android Wi-Fi socket connection timeout and close if there is no activity over the connection for certain length of time?
Thanks,
Barry.
I have a couple of phones that connect to a tablet using Android sockets / AsyncStreams / Prefix mode.
At the end of the day, after having the tablet instruct each phone to periodically take snapshots, the phones build a zip file containing all the snapshots from the phone and send it to the tablet as binary data in 64K chunks. (The transfer has to be done at the end of the day, not when the snapshots are actually taken).
This zip file can be pretty huge (300 MB). I send the zip file in 64K chunks. I don't want to "saturate" the Wi-Fi connection with this huge transfer.
1) Is there a way on the phone to tell when each chunk has been transferred via Wi-Fi so I can pause a little, letting somebody else jump onto the Wi-Fi if they want, before I try to send the next chunk?
Something like checking for WriteBufferEmpty on the stream then pausing 5 ms before writing the next chunk.
2) Transferring one of the zip files could take a while – maybe 20 minutes. Both phones are connected to the tablet during the transfer. One phone will be sending its zip file and the other phone sitting there doing nothing waiting for a request from the tablet to begin its turn to start sending.
Will an Android Wi-Fi socket connection timeout and close if there is no activity over the connection for certain length of time?
Thanks,
Barry.