Skip to content

Wifi java.net.SocketTimeoutException: failed to connect to host #5453

@SergeyBukarev

Description

@SergeyBukarev

Preconditions:

  1. Network hadware:
    Amplifier of 3G/LTE signal + Wifi router.
  2. Devices:
    Samsung galaxy A10 Android 9
    iPhone 8 Plus iOS 12.4
  3. Application:
    I have two applications (iOS and Android) that interact with the same server.
    Android aplication uses library okhttp:4.2.0 and makes requests through okhttp.

Test #1
Device: iPhone 8 Plus iOS 12.4.
Mobile network (3G/LTE) data is disabled, connected by wifi.
Request GET with MyTestApp iOS aplication:
The request is successful and the result is returned.

Test #2
Device: iPhone 8 Plus iOS 12.4.
Mobile network (3G/LTE) data is enabled. Wifi is disabled.
Request GET with MyTestApp iOS aplication:
The request is successful and the result is returned.

Test #3
Device: Samsung galaxy A10 Android 9
Mobile network (3G/LTE) data is disabled, connected by wifi.
Request GET with MyTestApp android aplication:
Logcat: HTTP FAILED: java.net.SocketTimeoutException: failed to connect to [MyServerName]/46.148.196.218 (port 4002) from /10.0.1.7 (port 37470) after 30000ms

Test #4
Device: Samsung galaxy A10 Android 9
Mobile network (3G/LTE) data is disabled, connected by wifi.
Request GET with RestApiClient android aplication:
(https://play.google.com/store/apps/details?id=com.app.restclient)
Logcat: HTTP FAILED: java.net.SocketTimeoutException: failed to connect to [MyServerName]/46.148.196.218 (port 4002) from /10.0.1.7 (port 37504) after 60000ms

Test #5
Device: Samsung galaxy A10 Android 9
Mobile network (3G/LTE) data is enabled. Wifi is disabled.
Request with MyTestApp android aplication:
The request is successful and the result is returned.

Conclusion:
The ios application always work fine with any network configuration. Android application does not work through a wifi router in 80% of cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug in existing codestackoverflowReferred to stackoverflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions