+28
-7
lines changedFilter options
+28
-7
lines changed Original file line number Diff line number Diff line change
@@ -4,9 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
7
-
## [Unreleased](https://github.com/pusher/NWWebSocket/compare/0.5.6...HEAD)
7
+
## [Unreleased](https://github.com/pusher/NWWebSocket/compare/0.5.7...HEAD)
8
8
9
-
## [0.5.5](https://github.com/pusher/NWWebSocket/compare/0.5.5...0.5.6) - 2025-06-18
9
+
## [0.5.7](https://github.com/pusher/NWWebSocket/compare/0.5.6...0.5.7) - 2025-06-19
10
+
11
+
### Fixed
12
+
13
+
- Handle connecting after connection is started [#58]
14
+
15
+
## [0.5.6](https://github.com/pusher/NWWebSocket/compare/0.5.5...0.5.6) - 2025-06-18
10
16
11
17
### Fixed
12
18
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
Pod::Spec.new do |s|
2
2
s.name = 'NWWebSocket'
3
-
s.version = '0.5.6'
3
+
s.version = '0.5.7'
4
4
s.summary = 'A WebSocket client written in Swift, using the Network framework from Apple'
5
5
s.homepage = 'https://github.com/pusher/NWWebSocket'
6
6
s.license = 'MIT'
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ source 'https://github.com/CocoaPods/Specs.git'
48
48
platform :ios, '14.0'
49
49
use_frameworks!
50
50
51
-
pod 'NWWebSocket', '~> 0.5.6'
51
+
pod 'NWWebSocket', '~> 0.5.7'
52
52
```
53
53
54
54
Then, run the following command:
@@ -90,7 +90,7 @@ let package = Package(
90
90
],
91
91
dependencies: [
92
92
.package(url: "https://github.com/pusher/NWWebSocket.git",
93
-
.upToNextMajor(from: "0.5.6")),
93
+
.upToNextMajor(from: "0.5.7")),
94
94
],
95
95
targets: [
96
96
.target(
Original file line number Diff line number Diff line change
@@ -126,8 +126,23 @@ open class NWWebSocket: WebSocketConnection {
126
126
}
127
127
listen()
128
128
connection?.start(queue: connectionQueue)
129
-
} else if connection?.state != .ready && !isMigratingConnection {
130
-
connection?.start(queue: connectionQueue)
129
+
} else if let conn = connection, !isMigratingConnection {
130
+
// Only start if the connection is in a state that allows starting
131
+
switch conn.state {
132
+
case .setup:
133
+
// Connection exists but hasn't been started yet
134
+
conn.start(queue: connectionQueue)
135
+
case .cancelled, .failed:
136
+
// Connection is dead - don't try to start it
137
+
// Let the stateDidChange handler deal with cleanup
138
+
break
139
+
case .ready, .preparing, .waiting:
140
+
// Connection is already started or connected - do nothing
141
+
break
142
+
@unknown default:
143
+
// Handle unknown states safely
144
+
break
145
+
}
131
146
}
132
147
}
133
148
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4