SocketManagerSpec
public protocol SocketManagerSpec : AnyObject, SocketEngineClientA manager for a socket.io connection.
A SocketManagerSpec is responsible for multiplexing multiple namespaces through a single SocketEngineSpec.
Example with SocketManager:
let manager = SocketManager(socketURL: URL(string:"http://localhost:8080/")!)
let defaultNamespaceSocket = manager.defaultSocket
let swiftSocket = manager.socket(forNamespace: "/swift")
// defaultNamespaceSocket and swiftSocket both share a single connection to the server
Sockets created through the manager are retained by the manager. So at the very least, a single strong reference to the manager must be maintained to keep sockets alive.
To disconnect a socket and remove it from the manager, either call SocketIOClient.disconnect() on the socket,
or call one of the disconnectSocket methods on this class.
- 
                  
                  Returns the socket associated with the default namespace (“/”). DeclarationSwift var defaultSocket: SocketIOClient { get }
- 
                  
                  The engine for this manager. DeclarationSwift var engine: SocketEngineSpec? { get set }
- 
                  
                  If truethen every timeconnectis called, a new engine will be created.DeclarationSwift var forceNew: Bool { get set }
- 
                  
                  The queue that all interaction with the client should occur on. This is the queue that event handlers are called on. DeclarationSwift var handleQueue: DispatchQueue { get set }
- 
                  
                  The sockets in this manager indexed by namespace. DeclarationSwift var nsps: [String : SocketIOClient] { get set }
- 
                  
                  If true, this manager will try and reconnect on any disconnects.DeclarationSwift var reconnects: Bool { get set }
- 
                  
                  The minimum number of seconds to wait before attempting to reconnect. DeclarationSwift var reconnectWait: Int { get set }
- 
                  
                  The maximum number of seconds to wait before attempting to reconnect. DeclarationSwift var reconnectWaitMax: Int { get set }
- 
                  
                  The randomization factor for calculating reconnect jitter. DeclarationSwift var randomizationFactor: Double { get set }
- 
                  
                  The URL of the socket.io server. DeclarationSwift var socketURL: URL { get }
- 
                  
                  The status of this manager. DeclarationSwift var status: SocketIOStatus { get }
- 
                  
                  The version of socket.io in use. DeclarationSwift var version: SocketIOVersion { get }
- 
                  
                  Connects the underlying transport. DeclarationSwift func connect()
- 
                  
                  Connects a socket through this manager’s engine. DeclarationSwift func connectSocket(_ socket: SocketIOClient, withPayload: [String : Any]?)ParameterssocketThe socket who we should connect through this manager. withPayloadOptional payload to send on connect 
- 
                  
                  Called when the manager has disconnected from socket.io. DeclarationSwift func didDisconnect(reason: String)ParametersreasonThe reason for the disconnection. 
- 
                  
                  Disconnects the manager and all associated sockets. DeclarationSwift func disconnect()
- 
                  
                  Disconnects the given socket. DeclarationSwift func disconnectSocket(_ socket: SocketIOClient)ParameterssocketThe socket to disconnect. 
- 
                  
                  Disconnects the socket associated with forNamespace.DeclarationSwift func disconnectSocket(forNamespace nsp: String)ParametersnspThe namespace to disconnect from. 
- 
                  
                  Sends an event to the server on all namespaces in this manager. DeclarationSwift func emitAll(_ event: String, _ items: SocketData...)ParameterseventThe event to send. itemsThe data to send with this event. 
- 
                  
                  Tries to reconnect to the server. This will cause a disconnectevent to be emitted, as well as anreconnectAttemptevent.DeclarationSwift func reconnect()
- 
                  
                  Removes the socket from the manager’s control. After calling this method the socket should no longer be considered usable. DeclarationSwift @discardableResult func removeSocket(_ socket: SocketIOClient) -> SocketIOClient?ParameterssocketThe socket to remove. Return ValueThe socket removed, if it was owned by the manager. 
- 
                  
                  Returns a SocketIOClientfor the given namespace. This socket shares a transport with the manager.Calling multiple times returns the same socket. Sockets created from this method are retained by the manager. Call one of the disconnectSocketmethods on the implementing class to remove the socket from manager control. Or callSocketIOClient.disconnect()on the client.DeclarationSwift func socket(forNamespace nsp: String) -> SocketIOClientParametersnspThe namespace for the socket. Return ValueA SocketIOClientfor the given namespace.
 SocketManagerSpec Protocol Reference
      SocketManagerSpec Protocol Reference