Skip to content

Commit 38dea9b

Browse files
Changed 'timeoutAfter' from Int to Double to allow more precise value
1 parent b86e787 commit 38dea9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/SocketIOClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec, SocketEngineClient, So
169169
/// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection
170170
/// has failed. Pass 0 to never timeout.
171171
/// - parameter withHandler: The handler to call when the client fails to connect.
172-
open func connect(timeoutAfter: Int, withHandler handler: (() -> ())?) {
172+
open func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) {
173173
assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)")
174174

175175
guard status != .connected else {
@@ -187,7 +187,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec, SocketEngineClient, So
187187

188188
guard timeoutAfter != 0 else { return }
189189

190-
handleQueue.asyncAfter(deadline: DispatchTime.now() + Double(timeoutAfter)) {[weak self] in
190+
handleQueue.asyncAfter(deadline: DispatchTime.now() + timeoutAfter) {[weak self] in
191191
guard let this = self, this.status == .connecting || this.status == .notConnected else { return }
192192

193193
this.status = .disconnected

0 commit comments

Comments
 (0)