Android Question Http problem in 5g situation

Rosin

Member
Licensed User
Hey guys,here i am using the httpjob to get the cookie from my school's websit,but i have noticed that when i am using wifi,i send the get request,and it respond very quickly...but when i am using my 5g network instead of wifi...it will wait...wait until 30s(the timeout) though it maybe have already got the response,i set the timeout to be 1000ms...and it gives the respond in 1s....what is the problem??i am so confused...here is my code,any reply is appreciated,thank you
 

Rosin

Member
Licensed User
Please use [code]code here...[/code] tags when posting code.

Job.Success will be false if the timeout is reached.
Are you sure that it always waits for the timeout value? This is not expected.

Thank you Erel,i am sure...it waits for 30s...but in wifi environment,it is a lot more fast
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
wifi is, by definition, different from cellular (5g or otherwise). for what it may be worth, i can
receive a response from your school very quickly over 5g, and i am some 12,000 kms away.

since i am not in your country, your school does not respond with the same data you are
looking for, but the response is quick. for obvious reasons, even i use my local network's
wifi, the actual connection to your school will not be via wifi. i assume when you say you
can connect via wifi, you mean over your school's local wifi network, which may actually
involve more than wifi, depending on the network's configuration and the size of your school.
if you are connecting from your home over wifi on your home network, the actual connection
to your school is not going to be wifi.

i notice in the response, some kind of challenge and a timeout. i did not bother with all your
http headers; perhaps there is an issue with one or more of them. what happens if you
connect without them? i notice you seem to have borrowed the headers directly from a
desktop browser's request. a desktop browser - if that's what you originally used to format
your request - may do more than a simple request with okhttputils. cutting and pasting may
be a problem.

in any case, there is no way for anyone other than someone on your school campus to
use wifi to connect with your school's server, so there is no way for anyway else to test
what you report. as for connecting over 5g, the response i received was very quick, just
like a normal okhttputils request.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…