nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

Network error handling in Socket.io Swift client (v 13.0.1) #150

Open kinza88 opened 6 years ago

kinza88 commented 6 years ago

When using Socket.io all i could found is timeout for .connect() as:

socket.connect(timeoutAfter: 5) {
     print("Could not connect")
}

How can i implement timeout in emit? I got an example of emitWithAck but that wasn't clear enough. I want to ask that how can I get all the network errors in .connect or .emit? For example, when the server is down "could not connect to server" message gets printed in the log. But how can I handle it through callbacks? Any help would be appreciated.

kinza88 commented 6 years ago

@nuclearace I need you to have a look in this. Thankyou.