remove deprecated methods
This commit is contained in:
parent
4f5837afa7
commit
a0167ae213
@ -122,18 +122,6 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
|
|||||||
self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? [])
|
self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? [])
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, deprecated=5.3, message="Please use the NSURL based init")
|
|
||||||
public convenience init(client: SocketEngineClient, urlString: String, options: Set<SocketIOClientOption>) {
|
|
||||||
guard let url = NSURL(string: urlString) else { fatalError("Incorrect url") }
|
|
||||||
self.init(client: client, url: url, options: options)
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(*, deprecated=5.3, message="Please use the NSURL based init")
|
|
||||||
public convenience init(client: SocketEngineClient, urlString: String, options: NSDictionary?) {
|
|
||||||
guard let url = NSURL(string: urlString) else { fatalError("Incorrect url") }
|
|
||||||
self.init(client: client, url: url, options: options?.toSocketOptionsSet() ?? [])
|
|
||||||
}
|
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
DefaultSocketLogger.Logger.log("Engine is being released", type: logType)
|
DefaultSocketLogger.Logger.log("Engine is being released", type: logType)
|
||||||
closed = true
|
closed = true
|
||||||
@ -184,15 +172,11 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func close(reason: String) {
|
|
||||||
disconnect(reason)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Starts the connection to the server
|
/// Starts the connection to the server
|
||||||
public func connect() {
|
public func connect() {
|
||||||
if connected {
|
if connected {
|
||||||
DefaultSocketLogger.Logger.error("Engine tried opening while connected. Assuming this was a reconnect", type: logType)
|
DefaultSocketLogger.Logger.error("Engine tried opening while connected. Assuming this was a reconnect", type: logType)
|
||||||
close("reconnect")
|
disconnect("reconnect")
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultSocketLogger.Logger.log("Starting engine", type: logType)
|
DefaultSocketLogger.Logger.log("Starting engine", type: logType)
|
||||||
@ -284,7 +268,7 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
|
|||||||
public func didError(error: String) {
|
public func didError(error: String) {
|
||||||
DefaultSocketLogger.Logger.error(error, type: logType)
|
DefaultSocketLogger.Logger.error(error, type: logType)
|
||||||
client?.engineDidError(error)
|
client?.engineDidError(error)
|
||||||
close(error)
|
disconnect(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func disconnect(reason: String) {
|
public func disconnect(reason: String) {
|
||||||
@ -422,10 +406,6 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func open() {
|
|
||||||
connect()
|
|
||||||
}
|
|
||||||
|
|
||||||
public func parseEngineData(data: NSData) {
|
public func parseEngineData(data: NSData) {
|
||||||
DefaultSocketLogger.Logger.log("Got binary data: %@", type: "SocketEngine", args: data)
|
DefaultSocketLogger.Logger.log("Got binary data: %@", type: "SocketEngine", args: data)
|
||||||
client?.parseEngineBinaryData(data.subdataWithRange(NSMakeRange(1, data.length - 1)))
|
client?.parseEngineBinaryData(data.subdataWithRange(NSMakeRange(1, data.length - 1)))
|
||||||
|
|||||||
@ -49,13 +49,11 @@ import Foundation
|
|||||||
|
|
||||||
init(client: SocketEngineClient, url: NSURL, options: NSDictionary?)
|
init(client: SocketEngineClient, url: NSURL, options: NSDictionary?)
|
||||||
|
|
||||||
@available(*, deprecated=5.5, message="Please use disconnect") func close(reason: String)
|
|
||||||
func connect()
|
func connect()
|
||||||
func didError(error: String)
|
func didError(error: String)
|
||||||
func disconnect(reason: String)
|
func disconnect(reason: String)
|
||||||
func doFastUpgrade()
|
func doFastUpgrade()
|
||||||
func flushWaitingForPostToWebSocket()
|
func flushWaitingForPostToWebSocket()
|
||||||
@available(*, deprecated=5.5, message="Please use connect") func open()
|
|
||||||
func parseEngineData(data: NSData)
|
func parseEngineData(data: NSData)
|
||||||
func parseEngineMessage(message: String, fromPolling: Bool)
|
func parseEngineMessage(message: String, fromPolling: Bool)
|
||||||
func write(msg: String, withType type: SocketEnginePacketType, withData data: [NSData])
|
func write(msg: String, withType type: SocketEnginePacketType, withData data: [NSData])
|
||||||
|
|||||||
@ -108,18 +108,6 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
|
|||||||
self.init(socketURL: socketURL, options: options?.toSocketOptionsSet() ?? [])
|
self.init(socketURL: socketURL, options: options?.toSocketOptionsSet() ?? [])
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, deprecated=5.3, message="Please use the NSURL based init")
|
|
||||||
public convenience init(socketURLString: String, options: Set<SocketIOClientOption> = []) {
|
|
||||||
guard let url = NSURL(string: socketURLString) else { fatalError("Incorrect url") }
|
|
||||||
self.init(socketURL: url, options: options)
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(*, deprecated=5.3, message="Please use the NSURL based init")
|
|
||||||
public convenience init(socketURLString: String, options: NSDictionary?) {
|
|
||||||
guard let url = NSURL(string: socketURLString) else { fatalError("Incorrect url") }
|
|
||||||
self.init(socketURL: url, options: options?.toSocketOptionsSet() ?? [])
|
|
||||||
}
|
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
DefaultSocketLogger.Logger.log("Client is being released", type: logType)
|
DefaultSocketLogger.Logger.log("Client is being released", type: logType)
|
||||||
engine?.disconnect("Client Deinit")
|
engine?.disconnect("Client Deinit")
|
||||||
@ -133,11 +121,6 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
|
|||||||
return engine!
|
return engine!
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, deprecated=5.3, message="Please use disconnect()")
|
|
||||||
public func close() {
|
|
||||||
disconnect()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Connect to the server.
|
/// Connect to the server.
|
||||||
public func connect() {
|
public func connect() {
|
||||||
connect(timeoutAfter: 0, withTimeoutHandler: nil)
|
connect(timeoutAfter: 0, withTimeoutHandler: nil)
|
||||||
@ -402,11 +385,6 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
|
|||||||
anyHandler = handler
|
anyHandler = handler
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, deprecated=5.3, message="Please use one of the connect methods)")
|
|
||||||
public func open() {
|
|
||||||
connect()
|
|
||||||
}
|
|
||||||
|
|
||||||
public func parseEngineMessage(msg: String) {
|
public func parseEngineMessage(msg: String) {
|
||||||
DefaultSocketLogger.Logger.log("Should parse message: %@", type: "SocketIOClient", args: msg)
|
DefaultSocketLogger.Logger.log("Should parse message: %@", type: "SocketIOClient", args: msg)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user