I created a remote server for an app to connect to using sockets. It connects and receives data just fine when I’m using wi-fi but it rarely receives data when I’m using 3g. Is there a better way of connecting remotely?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What I understand is that you may be transferring a large amount of data over sockets.
So, when you are on a faster connection, it goes through quickly, but when you are on a slower 3G connection, it takes a long time to go through.
So, if possible try to reduce the amount of data which gets transferred.
You can also try some mechanism like
http://download.oracle.com/javase/1.5.0/docs/api/java/util/zip/GZIPOutputStream.html
There is a corresponding http://download.oracle.com/javase/1,5.0/docs/api/java/util/zip/GZIPInputStream.html .
These streams compress the data to send it over the socket and decompress on the receiving side. So, it increases your processing time a little bit but reduces the amount of data being transmitted.