Skip to content

Socket disconnect not fired when device loses network #1415

Open
@phansen-nd

Description

@phansen-nd

Version 16.0.0

Expected behavior
A connected socket will fire the disconnect event when a device loses network. Or fire any event, like statusChanged or reconnect.

Actual behavior
No disconnect event is emitted until the ping timeout 60 seconds later.

I've tried the following code to get any indication that the socket is no longer connected:

socket.onAny { event in
     print("Got event: \(event.event), with items: \(event.items)")
}
socket.connect()

but no event fires when the device loses network until 60 seconds later.

For what it's worth, the Java SocketIO client is connected to the same server and receives a disconnect event immediately upon losing network, so it does not seem to be anything to do with the server configuration.

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