remove deprecated methods

This commit is contained in:
Erik 2016-03-23 13:39:22 -04:00
parent 4f5837afa7
commit a0167ae213
3 changed files with 3 additions and 47 deletions

View File

@ -122,18 +122,6 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
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 {
DefaultSocketLogger.Logger.log("Engine is being released", type: logType)
closed = true
@ -183,16 +171,12 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
return false
}
}
public func close(reason: String) {
disconnect(reason)
}
/// Starts the connection to the server
public func connect() {
if connected {
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)
@ -284,7 +268,7 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
public func didError(error: String) {
DefaultSocketLogger.Logger.error(error, type: logType)
client?.engineDidError(error)
close(error)
disconnect(error)
}
public func disconnect(reason: String) {
@ -421,11 +405,7 @@ public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWeb
upgradeTransport()
}
}
public func open() {
connect()
}
public func parseEngineData(data: NSData) {
DefaultSocketLogger.Logger.log("Got binary data: %@", type: "SocketEngine", args: data)
client?.parseEngineBinaryData(data.subdataWithRange(NSMakeRange(1, data.length - 1)))

View File

@ -49,13 +49,11 @@ import Foundation
init(client: SocketEngineClient, url: NSURL, options: NSDictionary?)
@available(*, deprecated=5.5, message="Please use disconnect") func close(reason: String)
func connect()
func didError(error: String)
func disconnect(reason: String)
func doFastUpgrade()
func flushWaitingForPostToWebSocket()
@available(*, deprecated=5.5, message="Please use connect") func open()
func parseEngineData(data: NSData)
func parseEngineMessage(message: String, fromPolling: Bool)
func write(msg: String, withType type: SocketEnginePacketType, withData data: [NSData])

View File

@ -108,18 +108,6 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
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 {
DefaultSocketLogger.Logger.log("Client is being released", type: logType)
engine?.disconnect("Client Deinit")
@ -133,11 +121,6 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
return engine!
}
@available(*, deprecated=5.3, message="Please use disconnect()")
public func close() {
disconnect()
}
/// Connect to the server.
public func connect() {
connect(timeoutAfter: 0, withTimeoutHandler: nil)
@ -402,11 +385,6 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable
anyHandler = handler
}
@available(*, deprecated=5.3, message="Please use one of the connect methods)")
public func open() {
connect()
}
public func parseEngineMessage(msg: String) {
DefaultSocketLogger.Logger.log("Should parse message: %@", type: "SocketIOClient", args: msg)