This commit is contained in:
Erik 2016-03-25 09:48:04 -04:00
parent 8f8d5acdba
commit d4c01183ab
14 changed files with 17 additions and 17 deletions

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
public final class SocketAckEmitter: NSObject { public final class SocketAckEmitter : NSObject {
let socket: SocketIOClient let socket: SocketIOClient
let ackNum: Int let ackNum: Int

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
private struct SocketAck: Hashable, Equatable { private struct SocketAck : Hashable, Equatable {
let ack: Int let ack: Int
var callback: AckCallback! var callback: AckCallback!
var hashValue: Int { var hashValue: Int {

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
public final class SocketAnyEvent: NSObject { public final class SocketAnyEvent : NSObject {
public let event: String public let event: String
public let items: NSArray? public let items: NSArray?
override public var description: String { override public var description: String {

View File

@ -22,7 +22,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
protocol SocketClientSpec: class { protocol SocketClientSpec : class {
var nsp: String { get set } var nsp: String { get set }
var waitingPackets: [SocketPacket] { get set } var waitingPackets: [SocketPacket] { get set }

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
public final class SocketEngine: NSObject, SocketEnginePollable, SocketEngineWebsocket { public final class SocketEngine : NSObject, SocketEnginePollable, SocketEngineWebsocket {
public let emitQueue = dispatch_queue_create("com.socketio.engineEmitQueue", DISPATCH_QUEUE_SERIAL) public let emitQueue = dispatch_queue_create("com.socketio.engineEmitQueue", DISPATCH_QUEUE_SERIAL)
public let handleQueue = dispatch_queue_create("com.socketio.engineHandleQueue", DISPATCH_QUEUE_SERIAL) public let handleQueue = dispatch_queue_create("com.socketio.engineHandleQueue", DISPATCH_QUEUE_SERIAL)
public let parseQueue = dispatch_queue_create("com.socketio.engineParseQueue", DISPATCH_QUEUE_SERIAL) public let parseQueue = dispatch_queue_create("com.socketio.engineParseQueue", DISPATCH_QUEUE_SERIAL)

View File

@ -25,6 +25,6 @@
import Foundation import Foundation
@objc public enum SocketEnginePacketType: Int { @objc public enum SocketEnginePacketType : Int {
case Open, Close, Ping, Pong, Message, Upgrade, Noop case Open, Close, Ping, Pong, Message, Upgrade, Noop
} }

View File

@ -25,7 +25,7 @@
import Foundation import Foundation
/// Protocol that is used to implement socket.io polling support /// Protocol that is used to implement socket.io polling support
public protocol SocketEnginePollable: SocketEngineSpec { public protocol SocketEnginePollable : SocketEngineSpec {
var invalidated: Bool { get } var invalidated: Bool { get }
/// Holds strings waiting to be sent over polling. /// Holds strings waiting to be sent over polling.
/// You shouldn't need to mess with this. /// You shouldn't need to mess with this.

View File

@ -26,7 +26,7 @@
import Foundation import Foundation
/// Protocol that is used to implement socket.io WebSocket support /// Protocol that is used to implement socket.io WebSocket support
public protocol SocketEngineWebsocket: SocketEngineSpec, WebSocketDelegate { public protocol SocketEngineWebsocket : SocketEngineSpec, WebSocketDelegate {
var ws: WebSocket? { get } var ws: WebSocket? { get }
func sendWebSocketMessage(str: String, withType type: SocketEnginePacketType, withData datas: [NSData]) func sendWebSocketMessage(str: String, withType type: SocketEnginePacketType, withData datas: [NSData])

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
public final class SocketIOClient: NSObject, SocketEngineClient, SocketParsable { public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable {
public let socketURL: NSURL public let socketURL: NSURL
public private(set) var engine: SocketEngineSpec? public private(set) var engine: SocketEngineSpec?

View File

@ -24,11 +24,11 @@
import Foundation import Foundation
protocol ClientOption: CustomStringConvertible, Hashable { protocol ClientOption : CustomStringConvertible, Hashable {
func getSocketIOOptionValue() -> AnyObject func getSocketIOOptionValue() -> AnyObject
} }
public enum SocketIOClientOption: ClientOption { public enum SocketIOClientOption : ClientOption {
case ConnectParams([String: AnyObject]) case ConnectParams([String: AnyObject])
case Cookies([NSHTTPCookie]) case Cookies([NSHTTPCookie])
case DoubleEncodeUTF8(Bool) case DoubleEncodeUTF8(Bool)
@ -152,7 +152,7 @@ public func ==(lhs: SocketIOClientOption, rhs: SocketIOClientOption) -> Bool {
return lhs.description == rhs.description return lhs.description == rhs.description
} }
extension Set where Element: ClientOption { extension Set where Element : ClientOption {
mutating func insertIgnore(element: Element) { mutating func insertIgnore(element: Element) {
if !contains(element) { if !contains(element) {
insert(element) insert(element)

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
@objc public enum SocketIOClientStatus: Int, CustomStringConvertible { @objc public enum SocketIOClientStatus : Int, CustomStringConvertible {
case NotConnected, Closed, Connecting, Connected case NotConnected, Closed, Connecting, Connected
public var description: String { public var description: String {

View File

@ -24,7 +24,7 @@
import Foundation import Foundation
public protocol SocketLogger: class { public protocol SocketLogger : class {
/// Whether to log or not /// Whether to log or not
var log: Bool {get set} var log: Bool {get set}
@ -54,7 +54,7 @@ public extension SocketLogger {
} }
} }
class DefaultSocketLogger: SocketLogger { class DefaultSocketLogger : SocketLogger {
static var Logger: SocketLogger = DefaultSocketLogger() static var Logger: SocketLogger = DefaultSocketLogger()
var log = false var log = false

View File

@ -22,7 +22,7 @@
import Foundation import Foundation
protocol SocketParsable: SocketClientSpec { protocol SocketParsable : SocketClientSpec {
func parseBinaryData(data: NSData) func parseBinaryData(data: NSData)
func parseSocketMessage(message: String) func parseSocketMessage(message: String)
} }

View File

@ -18,7 +18,7 @@ infix operator <~ { associativity none precedence 130 }
private let lock = dispatch_semaphore_create(1) private let lock = dispatch_semaphore_create(1)
private var swiftRegexCache = [String: NSRegularExpression]() private var swiftRegexCache = [String: NSRegularExpression]()
internal final class SwiftRegex: NSObject, BooleanType { internal final class SwiftRegex : NSObject, BooleanType {
var target: String var target: String
var regex: NSRegularExpression var regex: NSRegularExpression