Skip to content

Commit

Permalink
manually add the changes of PR of main library: socketio#1464
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkessler-ch committed Sep 4, 2024
1 parent a21af10 commit b00f0b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let package = Package(
.library(name: "SocketIO", targets: ["SocketIO"])
],
dependencies: [
.package(url: "https://github.com/daltoniam/Starscream", .exactItem("4.0.6")),
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMajor(from: "4.0.8")),
],
targets: [
.target(name: "SocketIO", dependencies: ["Starscream"]),
Expand Down
3 changes: 2 additions & 1 deletion Source/SocketIO/Client/SocketIOClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {

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

DefaultSocketLogger.Logger.log("Timeout: Socket not connected, so setting to disconnected", type: this.logType)

this.status = .disconnected
this.leaveNamespace()

Expand Down
5 changes: 2 additions & 3 deletions Source/SocketIO/Manager/SocketManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ open class SocketManager: NSObject, SocketManagerSpec, SocketParsable, SocketDat
private(set) var reconnectAttempts = -1

private var _config: SocketIOClientConfiguration
private var currentReconnectAttempt = 0
internal var currentReconnectAttempt = 0
private var reconnecting = false

// MARK: Initializers
Expand Down Expand Up @@ -186,9 +186,8 @@ open class SocketManager: NSObject, SocketManagerSpec, SocketParsable, SocketDat
///
/// Override if you wish to attach a custom `SocketEngineSpec`.
open func connect() {
guard !status.active else {
guard status == .connected || (status == .connecting && currentReconnectAttempt == 0) {
DefaultSocketLogger.Logger.log("Tried connecting an already active socket", type: SocketManager.logType)

return
}

Expand Down

0 comments on commit b00f0b7

Please sign in to comment.