Skip to content

Commit 8db5692

Browse files
feat manager add force close without message
1 parent 047600e commit 8db5692

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Source/SocketIO/Manager/SocketManager.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ open class SocketManager: NSObject, SocketManagerSpec, SocketParsable, SocketDat
242242
engine?.disconnect(reason: "Disconnect")
243243
}
244244

245+
/// Force disconnects the manager and all associated sockets.
246+
open func close() {
247+
DefaultSocketLogger.Logger.log("Manager closing", type: SocketManager.logType)
248+
249+
status = .disconnected
250+
251+
engine?.close(reason: "Disconnect")
252+
}
253+
254+
245255
/// Disconnects the given socket.
246256
///
247257
/// This will remove the socket for the manager's control, and make the socket instance useless and ready for

Source/SocketIO/Manager/SocketManagerSpec.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public protocol SocketManagerSpec : SocketEngineClient {
105105
/// Disconnects the manager and all associated sockets.
106106
func disconnect()
107107

108+
/// Foce disconnects the manager and all associated sockets.
109+
func close()
110+
108111
/// Disconnects the given socket.
109112
///
110113
/// - parameter socket: The socket to disconnect.

0 commit comments

Comments
 (0)