Skip to content

LTE and 5G Network Connection Failure: POSIXErrorCode(rawValue: 50): Network is down #1455

Description

@DevPlayNew

Describe the bug

Hello,

First, thank you for providing an excellent library. I am currently implementing RTMP streaming using HaishinKit.swift. The implementation works perfectly in a WiFi environment. However, when switching to LTE and 5G environments, the connection fails with the following error log:

====================================
POSIXErrorCode(rawValue: 50): Network is down

WiFi Environment: The RTMP server connects successfully and streaming works smoothly.
LTE/5G Environment: The connection to the RTMP server fails, resulting in a NetConnection.Connect.Failed error along with POSIXErrorCode(rawValue: 50): Network is down.

Environment Details
HaishinKit.swift Version: Latest version (1.8.1)
iOS Version: iOS 14 and above
Network Environment: LTE and 5G

Troubleshooting Steps Taken
Server Address Verification: Ensured that the RTMP server address is correct. It connects successfully over WiFi.
Network Settings Verification: Verified that the ports are not blocked on LTE and 5G networks.
RTMP Server Configuration: Confirmed that the RTMP server is properly set up and accessible externally.
Log Inspection: Enabled and reviewed HaishinKit logs to diagnose the error cause.
Example Code Testing: Tested using the example code provided in the HaishinKit.swift repository to ensure correct implementation.

Inquiry
Could you please provide insights into why the POSIXErrorCode(rawValue: 50): Network is down error occurs in LTE and 5G environments? Additionally, I would like to know if there are any further steps or configurations I should check to resolve this issue. If there is any known bug or configuration related to this issue, your guidance would be greatly appreciated.

Thank you.

To Reproduce

Steps to Reproduce

  1. Set up an RTMP server that is accessible from both WiFi and cellular networks.
  2. Configure the HaishinKit.swift example app to connect to the RTMP server.
  3. Connect the device to a WiFi network and start streaming. Verify that the connection is successful.
  4. Switch the device to an LTE or 5G network.
  5. Attempt to start streaming again.

Expected behavior

The app should connect to the RTMP server and start streaming successfully over LTE and 5G networks, just as it does over WiFi.

Version

1.8.1

Smartphone info.

No response

Additional context

No response

Screenshots

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions