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