code style
This commit is contained in:
parent
4abd2ab671
commit
46a129072f
@ -643,17 +643,19 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if websocket {
|
guard websocket else {
|
||||||
connected = false
|
|
||||||
websocket = false
|
|
||||||
|
|
||||||
if let reason = error?.localizedDescription {
|
|
||||||
didError(reason: reason)
|
|
||||||
} else {
|
|
||||||
client?.engineDidClose(reason: "Socket Disconnected")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
flushProbeWait()
|
flushProbeWait()
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
connected = false
|
||||||
|
websocket = false
|
||||||
|
|
||||||
|
if let reason = error?.localizedDescription {
|
||||||
|
didError(reason: reason)
|
||||||
|
} else {
|
||||||
|
client?.engineDidClose(reason: "Socket Disconnected")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -237,7 +237,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec, SocketEngineClient, So
|
|||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
open func emit(_ event: String, _ items: SocketData...) {
|
open func emit(_ event: String, _ items: SocketData...) {
|
||||||
do {
|
do {
|
||||||
emit(event, with: try items.map({ try $0.socketRepresentation() }))
|
try emit(event, with: items.map({ try $0.socketRepresentation() }))
|
||||||
} catch let err {
|
} catch let err {
|
||||||
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
|
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
|
||||||
type: logType)
|
type: logType)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user