socket.io-client-swift icon indicating copy to clipboard operation
socket.io-client-swift copied to clipboard

connect timeout doesn't called when network is off

Open knine79 opened this issue 7 years ago • 1 comments

I disconnected all network of device when socket is already connected. And then I called connect(timeoutAfter: withHandler:) like below.

socket.connect(timeoutAfter: 1) { [weak self] in self?.delegate?.socketDidFailToSend(message: msg) }

But my handler couldn't get called. I think it's because connect(timeoutAfter: withHandler:) method calls handler only when this.status == .connecting || this.status == .notConnected

How do you think?

knine79 avatar Jan 28 '19 09:01 knine79

Especially on iOS and other systems that don't support background execution, it's probably best to take manual control of connecting/disconnecting. The client is reliant on the underlying networking to notify it of any connection issues.

That being said, can you post some logs that happen during your scenario?

nuclearace avatar Feb 11 '19 14:02 nuclearace