Open netmindz opened 10 years ago
I have retested with the current git source code and I can't reproduce the same pattern of calls, though I do still see quite a few calls to get the host name, which I think is caused by the liberal use of isMasterBackendConnected throughout the code. Adding these extra calls slows things down a lot when your away from home accessing over 3G so really should be avoided where possible surely ?
You have a good eye. GetHostName is called before other end points to see if the backend is running. It's a form of fault detection.
The response is the shortest available. Not counting the HTTP header, the XML returned is just the hostname and provides the final check of the network connection to the backend. Earlier releases just attempted to connect to port 6544 and, if memory serves, got a 3000 byte response.
The latency of the extra round trip to the server is the issue more than the size of the payload returned
Example of log of request being made by sync
192.168.1.123 - - [30/Jan/2014:21:57:45 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:57:46 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T17%3A00%3A00&EndTime=2014-02-05T17%3A59%3A59&StartChanId=1 HTTP/1.1" 200 16055 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:57:50 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:57:51 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T18%3A00%3A00&EndTime=2014-02-05T18%3A59%3A59&StartChanId=1 HTTP/1.1" 200 17324 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:57:55 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:57:55 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T19%3A00%3A00&EndTime=2014-02-05T19%3A59%3A59&StartChanId=1 HTTP/1.1" 200 16882 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:57:59 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:00 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T20%3A00%3A00&EndTime=2014-02-05T20%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15260 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:05 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:05 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T21%3A00%3A00&EndTime=2014-02-05T21%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15376 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:09 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:10 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T22%3A00%3A00&EndTime=2014-02-05T22%3A59%3A59&StartChanId=1 HTTP/1.1" 200 16645 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:14 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:14 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-05T23%3A00%3A00&EndTime=2014-02-05T23%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15821 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:18 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:18 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T00%3A00%3A00&EndTime=2014-02-06T00%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15862 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:21 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:22 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T01%3A00%3A00&EndTime=2014-02-06T01%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15455 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:26 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:27 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T02%3A00%3A00&EndTime=2014-02-06T02%3A59%3A59&StartChanId=1 HTTP/1.1" 200 13396 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:30 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:31 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T03%3A00%3A00&EndTime=2014-02-06T03%3A59%3A59&StartChanId=1 HTTP/1.1" 200 13367 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:34 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:35 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T04%3A00%3A00&EndTime=2014-02-06T04%3A59%3A59&StartChanId=1 HTTP/1.1" 200 12884 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:39 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:39 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T05%3A00%3A00&EndTime=2014-02-06T05%3A59%3A59&StartChanId=1 HTTP/1.1" 200 12633 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:42 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:43 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T06%3A00%3A00&EndTime=2014-02-06T06%3A59%3A59&StartChanId=1 HTTP/1.1" 200 14480 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:47 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:48 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T07%3A00%3A00&EndTime=2014-02-06T07%3A59%3A59&StartChanId=1 HTTP/1.1" 200 14570 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:51 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:51 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T08%3A00%3A00&EndTime=2014-02-06T08%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15040 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:55 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:55 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T09%3A00%3A00&EndTime=2014-02-06T09%3A59%3A59&StartChanId=1 HTTP/1.1" 200 16024 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:58:58 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:58:59 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T10%3A00%3A00&EndTime=2014-02-06T10%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15672 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:02 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:03 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T11%3A00%3A00&EndTime=2014-02-06T11%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15849 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:06 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:07 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T12%3A00%3A00&EndTime=2014-02-06T12%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15834 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:10 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:11 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T13%3A00%3A00&EndTime=2014-02-06T13%3A59%3A59&StartChanId=1 HTTP/1.1" 200 17152 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:14 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:15 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T14%3A00%3A00&EndTime=2014-02-06T14%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15667 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:17 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:18 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T15%3A00%3A00&EndTime=2014-02-06T15%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15853 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:21 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:22 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T16%3A00%3A00&EndTime=2014-02-06T16%3A59%3A59&StartChanId=1 HTTP/1.1" 200 15395 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:25 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:26 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T17%3A00%3A00&EndTime=2014-02-06T17%3A59%3A59&StartChanId=1 HTTP/1.1" 200 16179 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:28 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:29 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T18%3A00%3A00&EndTime=2014-02-06T18%3A59%3A59&StartChanId=1 HTTP/1.1" 200 17244 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:33 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent" 192.168.1.123 - - [30/Jan/2014:21:59:33 +0000] "GET /Guide/GetProgramGuide?StartTime=2014-02-06T19%3A00%3A00&EndTime=2014-02-06T19%3A59%3A59&StartChanId=1 HTTP/1.1" 200 16737 "-" "Dalvik/1.6.0 (Linux; U; Android 4.3; HTC One Build/JSS15J)" 192.168.1.123 - - [30/Jan/2014:21:59:37 +0000] "GET /Myth/GetHostName HTTP/1.1" 200 72 "-" "Android Application:MythTV_Android_Frontent"