Merge branch 'development'

* development: (24 commits)
  Add enum for client events. Resolves #675
  Add client event for status changes. Closes #668
  Remove from manager can be discarded
  Use xctool
  Go back to straight xcodebuild
  Try and fix travis
  Disable logging in tests, use xctool again
  Implement #672
  Document SocketIOClientSwift
  Document SocketAnyEvent
  Move operators inside type
  Document ack types
  Fix #667 Make no ack an enum case
  remove refactor build
  Open client
  Make client single queued
  Make engine single queued
  add ignore for appcode
  Fix #657
  Parsable doesn't have to be a client
  ...
This commit is contained in:
Erik 2017-05-07 11:42:54 -04:00
commit 46b63b52b2
No known key found for this signature in database
GPG Key ID: 4930B7C5FBC1A69D
67 changed files with 18250 additions and 446 deletions

4
.gitignore vendored
View File

@ -46,3 +46,7 @@ DerivedData
*.xcuserstate
Socket.IO-Test-Server/node_modules/*
.idea/
docs/docsets/
docs/undocumented.json

View File

@ -9,5 +9,7 @@ branches:
before_install:
- brew update
- brew outdated xctool || brew upgrade xctool
# script: xctool -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build test -parallelize
script: xcodebuild -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build test
script:
- xcodebuild -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build-for-testing -quiet
- xctool -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac run-tests --parallelize
#script: xcodebuild -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build test

View File

@ -9,7 +9,7 @@ import SocketIO
let socket = SocketIOClient(socketURL: URL(string: "http://localhost:8080")!, config: [.log(true), .forcePolling(true)])
socket.on("connect") {data, ack in
socket.on(clientEvent: .connect) {data, ack in
print("socket connected")
}
@ -70,13 +70,11 @@ If you need Swift 1.2 use v2.4.5 (Pre-Swift 2 support is no longer maintained)
If you need Swift 1.1 use v1.5.2. (Pre-Swift 1.2 support is no longer maintained)
Manually (iOS 7+)
-----------------
### Manually (iOS 7+)
1. Copy the Source folder into your Xcode project. (Make sure you add the files to your target(s))
2. If you plan on using this from Objective-C, read [this](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html) on exposing Swift code to Objective-C.
Swift Package Manager
---------------------
### Swift Package Manager
Add the project as a dependency to your Package.swift:
```swift
import PackageDescription
@ -91,8 +89,7 @@ let package = Package(
Then import `import SocketIO`.
Carthage
-----------------
### Carthage
Add this line to your `Cartfile`:
```
github "socketio/socket.io-client-swift" ~> 8.3.3 # Or latest version
@ -100,8 +97,7 @@ github "socketio/socket.io-client-swift" ~> 8.3.3 # Or latest version
Run `carthage update --platform ios,macosx`.
CocoaPods 1.0.0 or later
------------------
### CocoaPods 1.0.0 or later
Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
```ruby
@ -131,8 +127,7 @@ Objective-C:
@import SocketIO;
```
CocoaSeeds
-----------------
### CocoaSeeds
Add this line to your `Seedfile`:
@ -150,8 +145,7 @@ Constructors
`convenience init(socketURL: NSURL, options: NSDictionary?)` - Same as above, but meant for Objective-C. See Options on how convert between SocketIOClientOptions and dictionary keys.
Options
-------
### Options
All options are a case of SocketIOClientOption. To get the Objective-C Option, convert the name to lowerCamelCase.
```swift
@ -176,8 +170,7 @@ case security(SSLSecurity) // Allows you to set which certs are valid. Useful fo
case selfSigned(Bool) // Sets WebSocket.selfSignedSSL. Use this if you're using self-signed certs.
case voipEnabled(Bool) // Only use this option if you're using the client with VoIP services. Changes the way the WebSocket is created. Default is false
```
Methods
-------
### Methods
1. `on(_ event: String, callback: NormalCallback) -> NSUUID` - Adds a handler for an event. Items are passed by an array. `ack` can be used to send an ack when one is requested. See example. Returns a unique id for the handler.
2. `once(_ event: String, callback: NormalCallback) -> NSUUID` - Adds a handler that will only be executed once. Returns a unique id for the handler.
3. `onAny(callback:((event: String, items: AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
@ -195,8 +188,7 @@ Methods
15. `off(id id: NSUUID)` - Removes the event that corresponds to id.
16. `removeAllHandlers()` - Removes all handlers.
Client Events
------
### Client Events
1. `connect` - Emitted when on a successful connection.
2. `disconnect` - Emitted when the connection is closed.
3. `error` - Emitted on an error.

View File

@ -9,18 +9,43 @@
import XCTest
@testable import SocketIO
class SocketAckManagerTest: XCTestCase {
class SocketAckManagerTest : XCTestCase {
var ackManager = SocketAckManager()
func testAddAcks() {
let callbackExpection = self.expectation(description: "callbackExpection")
let callbackExpection = expectation(description: "callbackExpection")
let itemsArray = ["Hi", "ho"]
func callback(_ items: [Any]) {
callbackExpection.fulfill()
}
ackManager.addAck(1, callback: callback)
ackManager.executeAck(1, with: itemsArray, onQueue: DispatchQueue.main)
waitForExpectations(timeout: 3.0, handler: nil)
}
func testManagerTimeoutAck() {
let callbackExpection = expectation(description: "Manager should timeout ack with noAck status")
let itemsArray = ["Hi", "ho"]
func callback(_ items: [Any]) {
XCTAssertEqual(items.count, 1, "Timed out ack should have one value")
guard let timeoutReason = items[0] as? String else {
XCTFail("Timeout reason should be a string")
return
}
XCTAssertEqual(timeoutReason, SocketAckStatus.noAck.rawValue)
callbackExpection.fulfill()
}
ackManager.addAck(1, callback: callback)
ackManager.timeoutAck(1, onQueue: DispatchQueue.main)
waitForExpectations(timeout: 0.2, handler: nil)
}
}

View File

@ -21,7 +21,7 @@
- (void)setUp {
[super setUp];
NSURL* url = [[NSURL alloc] initWithString:@"http://localhost"];
self.socket = [[SocketIOClient alloc] initWithSocketURL:url config:@{@"log": @YES, @"forcePolling": @YES}];
self.socket = [[SocketIOClient alloc] initWithSocketURL:url config:@{@"log": @NO, @"forcePolling": @YES}];
}
- (void)testOnSyntax {
@ -36,7 +36,7 @@
- (void)testEmitWithAckSyntax {
[[self.socket emitWithAck:@"testAckEmit" with:@[@YES]] timingOutAfter:0 callback:^(NSArray* data) {
}];
}

View File

@ -10,77 +10,67 @@ import XCTest
@testable import SocketIO
class SocketSideEffectTest: XCTestCase {
let data = "test".data(using: String.Encoding.utf8)!
let data2 = "test2".data(using: String.Encoding.utf8)!
private var socket: SocketIOClient!
override func setUp() {
super.setUp()
socket = SocketIOClient(socketURL: URL(string: "http://localhost/")!)
socket.setTestable()
}
func testInitialCurrentAck() {
XCTAssertEqual(socket.currentAck, -1)
}
func testFirstAck() {
socket.emitWithAck("test").timingOut(after: 0) {data in}
XCTAssertEqual(socket.currentAck, 0)
}
func testSecondAck() {
socket.emitWithAck("test").timingOut(after: 0) {data in}
socket.emitWithAck("test").timingOut(after: 0) {data in}
XCTAssertEqual(socket.currentAck, 1)
}
func testHandleAck() {
let expect = expectation(description: "handled ack")
socket.emitWithAck("test").timingOut(after: 0) {data in
XCTAssertEqual(data[0] as? String, "hello world")
expect.fulfill()
}
socket.parseSocketMessage("30[\"hello world\"]")
waitForExpectations(timeout: 3, handler: nil)
}
func testHandleAck2() {
let expect = expectation(description: "handled ack2")
socket.emitWithAck("test").timingOut(after: 0) {data in
XCTAssertTrue(data.count == 2, "Wrong number of ack items")
expect.fulfill()
}
socket.parseSocketMessage("61-0[{\"_placeholder\":true,\"num\":0},{\"test\":true}]")
socket.parseBinaryData(Data())
waitForExpectations(timeout: 3, handler: nil)
}
func testHandleEvent() {
let expect = expectation(description: "handled event")
socket.on("test") {data, ack in
XCTAssertEqual(data[0] as? String, "hello world")
expect.fulfill()
}
socket.parseSocketMessage("2[\"test\",\"hello world\"]")
waitForExpectations(timeout: 3, handler: nil)
}
func testHandleStringEventWithQuotes() {
let expect = expectation(description: "handled event")
socket.on("test") {data, ack in
XCTAssertEqual(data[0] as? String, "\"hello world\"")
expect.fulfill()
}
socket.parseSocketMessage("2[\"test\",\"\\\"hello world\\\"\"]")
waitForExpectations(timeout: 3, handler: nil)
}
func testHandleOnceEvent() {
let expect = expectation(description: "handled event")
socket.once("test") {data, ack in
@ -88,11 +78,11 @@ class SocketSideEffectTest: XCTestCase {
XCTAssertEqual(self.socket.testHandlers.count, 0)
expect.fulfill()
}
socket.parseSocketMessage("2[\"test\",\"hello world\"]")
waitForExpectations(timeout: 3, handler: nil)
}
func testOffWithEvent() {
socket.on("test") {data, ack in }
XCTAssertEqual(socket.testHandlers.count, 1)
@ -101,7 +91,7 @@ class SocketSideEffectTest: XCTestCase {
socket.off("test")
XCTAssertEqual(socket.testHandlers.count, 0)
}
func testOffWithId() {
let handler = socket.on("test") {data, ack in }
XCTAssertEqual(socket.testHandlers.count, 1)
@ -110,7 +100,7 @@ class SocketSideEffectTest: XCTestCase {
socket.off(id: handler)
XCTAssertEqual(socket.testHandlers.count, 1)
}
func testHandlesErrorPacket() {
let expect = expectation(description: "Handled error")
socket.on("error") {data, ack in
@ -118,11 +108,11 @@ class SocketSideEffectTest: XCTestCase {
expect.fulfill()
}
}
socket.parseSocketMessage("4\"test error\"")
waitForExpectations(timeout: 3, handler: nil)
}
func testHandleBinaryEvent() {
let expect = expectation(description: "handled binary event")
socket.on("test") {data, ack in
@ -131,12 +121,12 @@ class SocketSideEffectTest: XCTestCase {
expect.fulfill()
}
}
socket.parseSocketMessage("51-[\"test\",{\"test\":{\"_placeholder\":true,\"num\":0}}]")
socket.parseBinaryData(data)
waitForExpectations(timeout: 3, handler: nil)
}
func testHandleMultipleBinaryEvent() {
let expect = expectation(description: "handled multiple binary event")
socket.on("test") {data, ack in
@ -147,22 +137,97 @@ class SocketSideEffectTest: XCTestCase {
expect.fulfill()
}
}
socket.parseSocketMessage("52-[\"test\",{\"test\":{\"_placeholder\":true,\"num\":0},\"test2\":{\"_placeholder\":true,\"num\":1}}]")
socket.parseBinaryData(data)
socket.parseBinaryData(data2)
waitForExpectations(timeout: 3, handler: nil)
}
func testSocketManager() {
let manager = SocketClientManager.sharedManager
manager["test"] = socket
XCTAssert(manager["test"] === socket, "failed to get socket")
manager["test"] = nil
XCTAssert(manager["test"] == nil, "socket not removed")
}
func testChangingStatusCallsStatusChangeHandler() {
let expect = expectation(description: "The client should announce when the status changes")
let statusChange = SocketIOClientStatus.connecting
socket.on("statusChange") {data, ack in
guard let status = data[0] as? SocketIOClientStatus else {
XCTFail("Status should be one of the defined statuses")
return
}
XCTAssertEqual(status, statusChange, "The status changed should be the one set")
expect.fulfill()
}
socket.setTestStatus(statusChange)
waitForExpectations(timeout: 0.2)
}
func testOnClientEvent() {
let expect = expectation(description: "The client should call client event handlers")
let event = SocketClientEvent.disconnect
let closeReason = "testing"
socket.on(clientEvent: event) {data, ack in
guard let reason = data[0] as? String else {
XCTFail("Client should pass data for client events")
return
}
XCTAssertEqual(closeReason, reason, "The data should be what was sent to handleClientEvent")
expect.fulfill()
}
socket.handleClientEvent(event, data: [closeReason])
waitForExpectations(timeout: 0.2)
}
func testClientEventsAreBackwardsCompatible() {
let expect = expectation(description: "The client should call old style client event handlers")
let event = SocketClientEvent.disconnect
let closeReason = "testing"
socket.on("disconnect") {data, ack in
guard let reason = data[0] as? String else {
XCTFail("Client should pass data for client events")
return
}
XCTAssertEqual(closeReason, reason, "The data should be what was sent to handleClientEvent")
expect.fulfill()
}
socket.handleClientEvent(event, data: [closeReason])
waitForExpectations(timeout: 0.2)
}
let data = "test".data(using: String.Encoding.utf8)!
let data2 = "test2".data(using: String.Encoding.utf8)!
private var socket: SocketIOClient!
override func setUp() {
super.setUp()
socket = SocketIOClient(socketURL: URL(string: "http://localhost/")!)
socket.setTestable()
}
}

View File

@ -22,66 +22,92 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Dispatch
import Foundation
/// A class that represents a waiting ack call.
///
/// **NOTE**: You should not store this beyond the life of the event handler.
public final class SocketAckEmitter : NSObject {
let socket: SocketIOClient
let ackNum: Int
// MARK: Properties
/// If true, this handler is expecting to be acked. Call `with(_: SocketData...)` to ack.
public var expected: Bool {
return ackNum != -1
}
init(socket: SocketIOClient, ackNum: Int) {
self.socket = socket
self.ackNum = ackNum
}
// MARK: Methods
/// Call to ack receiving this event.
///
/// - parameter items: A variable number of items to send when acking.
public func with(_ items: SocketData...) {
guard ackNum != -1 else { return }
socket.emitAck(ackNum, with: items)
}
/// Call to ack receiving this event.
///
/// - parameter items: An array of items to send when acking. Use `[]` to send nothing.
public func with(_ items: [Any]) {
guard ackNum != -1 else { return }
socket.emitAck(ackNum, with: items)
}
}
/// A class that represents an emit that will request an ack that has not yet been sent.
/// Call `timingOut(after:callback:)` to complete the emit
/// Example:
///
/// ```swift
/// socket.emitWithAck("myEvent").timingOut(after: 1) {data in
/// ...
/// }
/// ```
public final class OnAckCallback : NSObject {
private let ackNumber: Int
private let items: [Any]
private weak var socket: SocketIOClient?
init(ackNumber: Int, items: [Any], socket: SocketIOClient) {
self.ackNumber = ackNumber
self.items = items
self.socket = socket
}
deinit {
DefaultSocketLogger.Logger.log("OnAckCallback for \(ackNumber) being released", type: "OnAckCallback")
}
// MARK: Methods
/// Completes an emitWithAck. If this isn't called, the emit never happens.
///
/// - parameter after: The number of seconds before this emit times out if an ack hasn't been received.
/// - parameter callback: The callback called when an ack is received, or when a timeout happens.
/// To check for timeout, use `SocketAckStatus`'s `noAck` case.
public func timingOut(after seconds: Int, callback: @escaping AckCallback) {
guard let socket = self.socket else { return }
socket.ackQueue.sync() {
socket.ackHandlers.addAck(ackNumber, callback: callback)
}
socket.ackHandlers.addAck(ackNumber, callback: callback)
socket._emit(items, ack: ackNumber)
guard seconds != 0 else { return }
let time = DispatchTime.now() + Double(UInt64(seconds) * NSEC_PER_SEC) / Double(NSEC_PER_SEC)
socket.handleQueue.asyncAfter(deadline: time) {
socket.handleQueue.asyncAfter(deadline: DispatchTime.now() + Double(seconds)) {
socket.ackHandlers.timeoutAck(self.ackNumber, onQueue: socket.handleQueue)
}
}
}

View File

@ -22,58 +22,65 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Dispatch
import Foundation
/// The status of an ack.
public enum SocketAckStatus : String {
/// The ack timed out.
case noAck = "NO ACK"
}
private struct SocketAck : Hashable {
let ack: Int
var callback: AckCallback!
var hashValue: Int {
return ack.hashValue
}
init(ack: Int) {
self.ack = ack
}
init(ack: Int, callback: @escaping AckCallback) {
self.ack = ack
self.callback = callback
}
}
private func <(lhs: SocketAck, rhs: SocketAck) -> Bool {
return lhs.ack < rhs.ack
}
fileprivate static func <(lhs: SocketAck, rhs: SocketAck) -> Bool {
return lhs.ack < rhs.ack
}
private func ==(lhs: SocketAck, rhs: SocketAck) -> Bool {
return lhs.ack == rhs.ack
fileprivate static func ==(lhs: SocketAck, rhs: SocketAck) -> Bool {
return lhs.ack == rhs.ack
}
}
struct SocketAckManager {
private var acks = Set<SocketAck>(minimumCapacity: 1)
private let ackSemaphore = DispatchSemaphore(value: 1)
mutating func addAck(_ ack: Int, callback: @escaping AckCallback) {
acks.insert(SocketAck(ack: ack, callback: callback))
}
/// Should be called on handle queue
mutating func executeAck(_ ack: Int, with items: [Any], onQueue: DispatchQueue) {
ackSemaphore.wait()
defer { ackSemaphore.signal() }
let ack = acks.remove(SocketAck(ack: ack))
onQueue.async() { ack?.callback(items) }
}
/// Should be called on handle queue
mutating func timeoutAck(_ ack: Int, onQueue: DispatchQueue) {
ackSemaphore.wait()
defer { ackSemaphore.signal() }
let ack = acks.remove(SocketAck(ack: ack))
onQueue.async() {
ack?.callback?(["NO ACK"])
ack?.callback?([SocketAckStatus.noAck.rawValue])
}
}
}

View File

@ -24,13 +24,21 @@
import Foundation
/// Represents some event that was received.
public final class SocketAnyEvent : NSObject {
// MARK: Properties
/// The event name.
public let event: String
/// The data items for this event.
public let items: [Any]?
/// The description of this event.
override public var description: String {
return "SocketAnyEvent: Event: \(event) items: \(String(describing: items))"
}
init(event: String, items: [Any]?) {
self.event = event
self.items = items

View File

@ -26,14 +26,14 @@ import Foundation
/**
Experimental socket manager.
API subject to change.
Can be used to persist sockets across ViewControllers.
Sockets are strongly stored, so be sure to remove them once they are no
longer needed.
Example usage:
```
let manager = SocketClientManager.sharedManager
@ -44,38 +44,61 @@ import Foundation
```
*/
open class SocketClientManager : NSObject {
// MARK: Properties.
/// The shared manager.
open static let sharedManager = SocketClientManager()
private var sockets = [String: SocketIOClient]()
/// Gets a socket by its name.
///
/// - returns: The socket, if one had the given name.
open subscript(string: String) -> SocketIOClient? {
get {
return sockets[string]
}
set(socket) {
sockets[string] = socket
}
}
// MARK: Methods.
/// Adds a socket.
///
/// - parameter socket: The socket to add.
/// - parameter labeledAs: The label for this socket.
open func addSocket(_ socket: SocketIOClient, labeledAs label: String) {
sockets[label] = socket
}
/// Removes a socket by a given name.
///
/// - parameter withLabel: The label of the socket to remove.
/// - returns: The socket for the given label, if one was present.
@discardableResult
open func removeSocket(withLabel label: String) -> SocketIOClient? {
return sockets.removeValue(forKey: label)
}
/// Removes a socket.
///
/// - parameter socket: The socket to remove.
/// - returns: The socket if it was in the manager.
@discardableResult
open func removeSocket(_ socket: SocketIOClient) -> SocketIOClient? {
var returnSocket: SocketIOClient?
for (label, dictSocket) in sockets where dictSocket === socket {
returnSocket = sockets.removeValue(forKey: label)
}
return returnSocket
}
/// Removes all the sockets in the manager.
open func removeSockets() {
sockets.removeAll()
}

View File

@ -22,42 +22,99 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Dispatch
import Foundation
/// The class that handles the engine.io protocol and transports.
/// See `SocketEnginePollable` and `SocketEngineWebsocket` for transport specific methods.
public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, SocketEngineWebsocket {
public let emitQueue = DispatchQueue(label: "com.socketio.engineEmitQueue", attributes: [])
public let handleQueue = DispatchQueue(label: "com.socketio.engineHandleQueue", attributes: [])
public let parseQueue = DispatchQueue(label: "com.socketio.engineParseQueue", attributes: [])
// MARK: Properties
/// The queue that all engine actions take place on.
public let engineQueue = DispatchQueue(label: "com.socketio.engineHandleQueue")
/// The connect parameters sent during a connect.
public var connectParams: [String: Any]? {
didSet {
(urlPolling, urlWebSocket) = createURLs()
}
}
/// A queue of engine.io messages waiting for POSTing
///
/// **You should not touch this directly**
public var postWait = [String]()
/// `true` if there is an outstanding poll. Trying to poll before the first is done will cause socket.io to
/// disconnect us.
///
/// **Do not touch this directly**
public var waitingForPoll = false
/// `true` if there is an outstanding post. Trying to post before the first is done will cause socket.io to
/// disconnect us.
///
/// **Do not touch this directly**
public var waitingForPost = false
/// `true` if this engine is closed.
public private(set) var closed = false
/// `true` if this engine is connected. Connected means that the initial poll connect has succeeded.
public private(set) var connected = false
/// An array of HTTPCookies that are sent during the connection.
public private(set) var cookies: [HTTPCookie]?
/// Set to `true` if using the node.js version of socket.io. The node.js version of socket.io
/// handles utf8 incorrectly.
public private(set) var doubleEncodeUTF8 = true
/// A dictionary of extra http headers that will be set during connection.
public private(set) var extraHeaders: [String: String]?
/// When `true`, the engine is in the process of switching to WebSockets.
///
/// **Do not touch this directly**
public private(set) var fastUpgrade = false
/// When `true`, the engine will only use HTTP long-polling as a transport.
public private(set) var forcePolling = false
/// When `true`, the engine will only use WebSockets as a transport.
public private(set) var forceWebsockets = false
/// `true` If engine's session has been invalidated.
public private(set) var invalidated = false
/// If `true`, the engine is currently in HTTP long-polling mode.
public private(set) var polling = true
/// If `true`, the engine is currently seeing whether it can upgrade to WebSockets.
public private(set) var probing = false
/// The URLSession that will be used for polling.
public private(set) var session: URLSession?
/// The session id for this engine.
public private(set) var sid = ""
/// The path to engine.io.
public private(set) var socketPath = "/engine.io/"
/// The url for polling.
public private(set) var urlPolling = URL(string: "http://localhost/")!
/// The url for WebSockets.
public private(set) var urlWebSocket = URL(string: "http://localhost/")!
/// If `true`, then the engine is currently in WebSockets mode.
public private(set) var websocket = false
/// The WebSocket for this engine.
public private(set) var ws: WebSocket?
/// The client for this engine.
public weak var client: SocketEngineClient?
private weak var sessionDelegate: URLSessionDelegate?
@ -80,6 +137,13 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
private var selfSigned = false
private var voipEnabled = false
// MARK: Initializers
/// Creates a new engine.
///
/// - parameter client: The client for this engine.
/// - parameter url: The url for this engine.
/// - parameter config: An array of configuration options for this engine.
public init(client: SocketEngineClient, url: URL, config: SocketIOClientConfiguration) {
self.client = client
self.url = url
@ -101,7 +165,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
forceWebsockets = force
case let .path(path):
socketPath = path
if !socketPath.hasSuffix("/") {
socketPath += "/"
}
@ -119,12 +183,17 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
super.init()
sessionDelegate = sessionDelegate ?? self
(urlPolling, urlWebSocket) = createURLs()
}
/// Creates a new engine.
///
/// - parameter client: The client for this engine.
/// - parameter url: The url for this engine.
/// - parameter options: The options for this engine.
public convenience init(client: SocketEngineClient, url: URL, options: NSDictionary?) {
self.init(client: client, url: url, config: options?.toSocketConfiguration() ?? [])
}
@ -135,11 +204,13 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
stopPolling()
}
// MARK: Methods
private func checkAndHandleEngineError(_ msg: String) {
do {
let dict = try msg.toNSDictionary()
guard let error = dict["message"] as? String else { return }
/*
0: Unknown transport
1: Unknown sid
@ -155,7 +226,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
private func handleBase64(message: String) {
// binary in base64 string
let noPrefix = message[message.index(message.startIndex, offsetBy: 2)..<message.endIndex]
if let data = NSData(base64Encoded: noPrefix, options: .ignoreUnknownCharacters) {
client?.parseEngineBinaryData(data as Data)
}
@ -172,8 +243,14 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
client?.engineDidClose(reason: reason)
}
/// Starts the connection to the server
/// Starts the connection to the server.
public func connect() {
engineQueue.async {
self._connect()
}
}
private func _connect() {
if connected {
DefaultSocketLogger.Logger.error("Engine tried opening while connected. Assuming this was a reconnect", type: logType)
disconnect(reason: "reconnect")
@ -191,7 +268,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
return
}
let reqPolling = NSMutableURLRequest(url: urlPolling)
var reqPolling = URLRequest(url: urlPolling, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 60.0)
if cookies != nil {
let headers = HTTPCookie.requestHeaderFields(with: cookies!)
@ -204,7 +281,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
}
doLongPoll(for: reqPolling as URLRequest)
doLongPoll(for: reqPolling)
}
private func createURLs() -> (URL, URL) {
@ -215,7 +292,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
var urlPolling = URLComponents(string: url.absoluteString)!
var urlWebSocket = URLComponents(string: url.absoluteString)!
var queryString = ""
urlWebSocket.path = socketPath
urlPolling.path = socketPath
@ -243,6 +320,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
private func createWebsocketAndConnect() {
ws?.delegate = nil
ws = WebSocket(url: urlWebSocketWithSid as URL)
if cookies != nil {
@ -258,7 +336,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
}
ws?.callbackQueue = handleQueue
ws?.callbackQueue = engineQueue
ws?.voipEnabled = voipEnabled
ws?.delegate = self
ws?.disableSSLCertValidation = selfSigned
@ -267,13 +345,23 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
ws?.connect()
}
/// Called when an error happens during execution. Causes a disconnection.
public func didError(reason: String) {
DefaultSocketLogger.Logger.error("%@", type: logType, args: reason)
client?.engineDidError(reason: reason)
disconnect(reason: reason)
}
/// Disconnects from the server.
///
/// - parameter reason: The reason for the disconnection. This is communicated up to the client.
public func disconnect(reason: String) {
engineQueue.async {
self._disconnect(reason: reason)
}
}
private func _disconnect(reason: String) {
guard connected else { return closeOutEngine(reason: reason) }
DefaultSocketLogger.Logger.log("Engine is being closed.", type: logType)
@ -293,14 +381,16 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
// We need to take special care when we're polling that we send it ASAP
// Also make sure we're on the emitQueue since we're touching postWait
private func disconnectPolling(reason: String) {
emitQueue.sync {
self.postWait.append(String(SocketEnginePacketType.close.rawValue))
let req = self.createRequestForPostWithPostWait()
self.doRequest(for: req) {_, _, _ in }
self.closeOutEngine(reason: reason)
}
postWait.append(String(SocketEnginePacketType.close.rawValue))
doRequest(for: createRequestForPostWithPostWait()) {_, _, _ in }
closeOutEngine(reason: reason)
}
/// Called to switch from HTTP long-polling to WebSockets. After calling this method the engine will be in
/// WebSocket mode.
///
/// **You shouldn't call this directly**
public func doFastUpgrade() {
if waitingForPoll {
DefaultSocketLogger.Logger.error("Outstanding poll when switched to WebSockets," +
@ -318,21 +408,21 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
private func flushProbeWait() {
DefaultSocketLogger.Logger.log("Flushing probe wait", type: logType)
emitQueue.async {
for waiter in self.probeWait {
self.write(waiter.msg, withType: waiter.type, withData: waiter.data)
}
for waiter in probeWait {
write(waiter.msg, withType: waiter.type, withData: waiter.data)
}
self.probeWait.removeAll(keepingCapacity: false)
probeWait.removeAll(keepingCapacity: false)
if self.postWait.count != 0 {
self.flushWaitingForPostToWebSocket()
}
if postWait.count != 0 {
flushWaitingForPostToWebSocket()
}
}
// We had packets waiting for send when we upgraded
// Send them raw
/// Causes any packets that were waiting for POSTing to be sent through the WebSocket. This happens because when
/// the engine is attempting to upgrade to WebSocket it does not do any POSTing.
///
/// **You shouldn't call this directly**
public func flushWaitingForPostToWebSocket() {
guard let ws = self.ws else { return }
@ -354,47 +444,47 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
private func handleNOOP() {
doPoll()
}
private func handleOpen(openData: String) {
guard let json = try? openData.toNSDictionary() else {
didError(reason: "Error parsing open packet")
return
}
guard let sid = json["sid"] as? String else {
didError(reason: "Open packet contained no sid")
return
}
let upgradeWs: Bool
self.sid = sid
connected = true
pongsMissed = 0
if let upgrades = json["upgrades"] as? [String] {
upgradeWs = upgrades.contains("websocket")
} else {
upgradeWs = false
}
if let pingInterval = json["pingInterval"] as? Double, let pingTimeout = json["pingTimeout"] as? Double {
self.pingInterval = pingInterval / 1000.0
self.pingTimeout = pingTimeout / 1000.0
}
if !forcePolling && !forceWebsockets && upgradeWs {
createWebsocketAndConnect()
}
sendPing()
if !forceWebsockets {
doPoll()
}
client?.engineDidOpen(reason: "Connect")
}
@ -407,25 +497,33 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
}
/// Parses raw binary received from engine.io.
///
/// - parameter data: The data to parse.
public func parseEngineData(_ data: Data) {
DefaultSocketLogger.Logger.log("Got binary data: %@", type: "SocketEngine", args: data)
client?.parseEngineBinaryData(data.subdata(in: 1..<data.endIndex))
}
/// Parses a raw engine.io packet.
///
/// - parameter message: The message to parse.
/// - parameter fromPolling: Whether this message is from long-polling.
/// If `true` we might have to fix utf8 encoding.
public func parseEngineMessage(_ message: String, fromPolling: Bool) {
DefaultSocketLogger.Logger.log("Got message: %@", type: logType, args: message)
let reader = SocketStringReader(message: message)
let fixedString: String
if message.hasPrefix("b4") {
return handleBase64(message: message)
}
guard let type = SocketEnginePacketType(rawValue: Int(reader.currentCharacter) ?? -1) else {
checkAndHandleEngineError(message)
return
}
@ -453,13 +551,16 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
// Puts the engine back in its default state
private func resetEngine() {
let queue = OperationQueue()
queue.underlyingQueue = engineQueue
closed = false
connected = false
fastUpgrade = false
polling = true
probing = false
invalidated = false
session = Foundation.URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: OperationQueue.main)
session = Foundation.URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: queue)
sid = ""
waitingForPoll = false
waitingForPost = false
@ -472,17 +573,16 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
// Server is not responding
if pongsMissed > pongsMissedMax {
client?.engineDidClose(reason: "Ping timeout")
return
}
guard let pingInterval = pingInterval else { return }
pongsMissed += 1
write("", withType: .ping, withData: [])
let time = DispatchTime.now() + Double(Int64(pingInterval * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)
DispatchQueue.main.asyncAfter(deadline: time) {[weak self] in self?.sendPing() }
engineQueue.asyncAfter(deadline: DispatchTime.now() + Double(pingInterval)) {[weak self] in self?.sendPing() }
}
// Moves from long-polling to websockets
@ -496,18 +596,22 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
}
/// Write a message, independent of transport.
/// Writes a message to engine.io, independent of transport.
///
/// - parameter msg: The message to send.
/// - parameter withType: The type of this message.
/// - parameter withData: Any data that this message has.
public func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) {
emitQueue.async {
engineQueue.async {
guard self.connected else { return }
if self.websocket {
DefaultSocketLogger.Logger.log("Writing ws: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
type: self.logType, args: msg, data.count != 0)
self.sendWebSocketMessage(msg, withType: type, withData: data)
} else if !self.probing {
DefaultSocketLogger.Logger.log("Writing poll: %@ has data: %@",
type: self.logType, args: msg, data.count != 0)
type: self.logType, args: msg, data.count != 0)
self.sendPollMessage(msg, withType: type, withData: data)
} else {
self.probeWait.append((msg, type, data))
@ -515,7 +619,9 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
}
// Delegate methods
// MARK: Starscream delegate conformance
/// Delegate method for connection.
public func websocketDidConnect(socket: WebSocket) {
if !forceWebsockets {
probing = true
@ -527,12 +633,13 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
}
/// Delegate method for disconnection.
public func websocketDidDisconnect(socket: WebSocket, error: NSError?) {
probing = false
if closed {
client?.engineDidClose(reason: "Disconnect")
return
}
@ -552,9 +659,12 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
}
extension SocketEngine {
// MARK: URLSessionDelegate methods
/// Delegate called when the session becomes invalid.
public func URLSession(session: URLSession, didBecomeInvalidWithError error: NSError?) {
DefaultSocketLogger.Logger.error("Engine URLSession became invalid", type: "SocketEngine")
didError(reason: "Engine URLSession became invalid")
}
}

View File

@ -25,10 +25,32 @@
import Foundation
@objc public protocol SocketEngineClient {
/// Declares that a type will be a delegate to an engine.
@objc public protocol SocketEngineClient {
// MARK: Methods
/// Called when the engine errors.
///
/// - parameter reason: The reason the engine errored.
func engineDidError(reason: String)
/// Called when the engine closes.
///
/// - parameter reason: The reason that the engine closed.
func engineDidClose(reason: String)
/// Called when the engine opens.
///
/// - parameter reason: The reason the engine opened.
func engineDidOpen(reason: String)
/// Called when the engine has a message that must be parsed.
///
/// - parameter msg: The message that needs parsing.
func parseEngineMessage(_ msg: String)
/// Called when the engine receives binary data.
///
/// - parameter data: The data the engine received.
func parseEngineBinaryData(_ data: Data)
}

View File

@ -25,6 +25,26 @@
import Foundation
/// Represents the type of engine.io packet types.
@objc public enum SocketEnginePacketType : Int {
case open, close, ping, pong, message, upgrade, noop
}
/// Open message.
case open
/// Close message.
case close
/// Ping message.
case ping
/// Pong message.
case pong
/// Regular message.
case message
/// Upgrade message.
case upgrade
/// NOOP.
case noop
}

View File

@ -26,20 +26,46 @@ import Foundation
/// Protocol that is used to implement socket.io polling support
public protocol SocketEnginePollable : SocketEngineSpec {
/// MARK: Properties
/// `true` If engine's session has been invalidated.
var invalidated: Bool { get }
/// Holds strings waiting to be sent over polling.
/// You shouldn't need to mess with this.
/// A queue of engine.io messages waiting for POSTing
///
/// **You should not touch this directly**
var postWait: [String] { get set }
/// The URLSession that will be used for polling.
var session: URLSession? { get }
/// Because socket.io doesn't let you send two polling request at the same time
/// we have to keep track if there's an outstanding poll
/// `true` if there is an outstanding poll. Trying to poll before the first is done will cause socket.io to
/// disconnect us.
///
/// **Do not touch this directly**
var waitingForPoll: Bool { get set }
/// Because socket.io doesn't let you send two post request at the same time
/// we have to keep track if there's an outstanding post
/// `true` if there is an outstanding post. Trying to post before the first is done will cause socket.io to
/// disconnect us.
///
/// **Do not touch this directly**
var waitingForPost: Bool { get set }
/// Call to send a long-polling request.
///
/// You shouldn't need to call this directly, the engine should automatically maintain a long-poll request.
func doPoll()
/// Sends an engine.io message through the polling transport.
///
/// You shouldn't call this directly, instead call the `write` method on `SocketEngine`.
///
/// - parameter message: The message to send.
/// - parameter withType: The type of message to send.
/// - parameter withData: The data associated with this message.
func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data])
/// Call to stop polling and invalidate the URLSession.
func stopPolling()
}
@ -47,95 +73,97 @@ public protocol SocketEnginePollable : SocketEngineSpec {
extension SocketEnginePollable {
private func addHeaders(for req: URLRequest) -> URLRequest {
var req = req
if cookies != nil {
let headers = HTTPCookie.requestHeaderFields(with: cookies!)
req.allHTTPHeaderFields = headers
}
if extraHeaders != nil {
for (headerName, value) in extraHeaders! {
req.setValue(value, forHTTPHeaderField: headerName)
}
}
return req
}
func createRequestForPostWithPostWait() -> URLRequest {
defer { postWait.removeAll(keepingCapacity: true) }
var postStr = ""
for packet in postWait {
let len = packet.characters.count
postStr += "\(len):\(packet)"
}
DefaultSocketLogger.Logger.log("Created POST string: %@", type: "SocketEnginePolling", args: postStr)
var req = URLRequest(url: urlPollingWithSid)
let postData = postStr.data(using: .utf8, allowLossyConversion: false)!
req = addHeaders(for: req)
req.httpMethod = "POST"
req.setValue("text/plain; charset=UTF-8", forHTTPHeaderField: "Content-Type")
req.httpBody = postData
req.setValue(String(postData.count), forHTTPHeaderField: "Content-Length")
return req as URLRequest
return req
}
/// Call to send a long-polling request.
///
/// You shouldn't need to call this directly, the engine should automatically maintain a long-poll request.
public func doPoll() {
if websocket || waitingForPoll || !connected || closed {
return
}
waitingForPoll = true
var req = URLRequest(url: urlPollingWithSid)
req = addHeaders(for: req)
doLongPoll(for: req )
}
func doRequest(for req: URLRequest, callbackWith callback: @escaping (Data?, URLResponse?, Error?) -> Void) {
if !polling || closed || invalidated || fastUpgrade {
return
}
DefaultSocketLogger.Logger.log("Doing polling request", type: "SocketEnginePolling")
DefaultSocketLogger.Logger.log("Doing polling %@ %@", type: "SocketEnginePolling",
args: req.httpMethod ?? "", req)
session?.dataTask(with: req, completionHandler: callback).resume()
}
func doLongPoll(for req: URLRequest) {
waitingForPoll = true
doRequest(for: req) {[weak self] data, res, err in
guard let this = self, this.polling else { return }
if err != nil || data == nil {
DefaultSocketLogger.Logger.error(err?.localizedDescription ?? "Error", type: "SocketEnginePolling")
if this.polling {
this.didError(reason: err?.localizedDescription ?? "Error")
}
return
}
DefaultSocketLogger.Logger.log("Got polling response", type: "SocketEnginePolling")
if let str = String(data: data!, encoding: String.Encoding.utf8) {
this.parseQueue.async {
this.parsePollingMessage(str)
}
this.parsePollingMessage(str)
}
this.waitingForPoll = false
if this.fastUpgrade {
this.doFastUpgrade()
} else if !this.closed && this.polling {
@ -143,7 +171,7 @@ extension SocketEnginePollable {
}
}
}
private func flushWaitingForPost() {
if postWait.count == 0 || !connected {
return
@ -151,79 +179,81 @@ extension SocketEnginePollable {
flushWaitingForPostToWebSocket()
return
}
let req = createRequestForPostWithPostWait()
waitingForPost = true
DefaultSocketLogger.Logger.log("POSTing", type: "SocketEnginePolling")
doRequest(for: req) {[weak self] data, res, err in
guard let this = self else { return }
if err != nil {
DefaultSocketLogger.Logger.error(err?.localizedDescription ?? "Error", type: "SocketEnginePolling")
if this.polling {
this.didError(reason: err?.localizedDescription ?? "Error")
}
return
}
this.waitingForPost = false
this.emitQueue.async {
if !this.fastUpgrade {
this.flushWaitingForPost()
this.doPoll()
}
if !this.fastUpgrade {
this.flushWaitingForPost()
this.doPoll()
}
}
}
func parsePollingMessage(_ str: String) {
guard str.characters.count != 1 else { return }
var reader = SocketStringReader(message: str)
while reader.hasNext {
if let n = Int(reader.readUntilOccurence(of: ":")) {
let str = reader.read(count: n)
handleQueue.async { self.parseEngineMessage(str, fromPolling: true) }
parseEngineMessage(reader.read(count: n), fromPolling: true)
} else {
handleQueue.async { self.parseEngineMessage(str, fromPolling: true) }
parseEngineMessage(str, fromPolling: true)
break
}
}
}
/// Send polling message.
/// Only call on emitQueue
/// Sends an engine.io message through the polling transport.
///
/// You shouldn't call this directly, instead call the `write` method on `SocketEngine`.
///
/// - parameter message: The message to send.
/// - parameter withType: The type of message to send.
/// - parameter withData: The data associated with this message.
public func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data]) {
DefaultSocketLogger.Logger.log("Sending poll: %@ as type: %@", type: "SocketEnginePolling", args: message, type.rawValue)
let fixedMessage: String
if doubleEncodeUTF8 {
fixedMessage = doubleEncodeUTF8(message)
} else {
fixedMessage = message
}
postWait.append(String(type.rawValue) + fixedMessage)
for data in datas {
if case let .right(bin) = createBinaryDataForSend(using: data) {
postWait.append(bin)
}
}
if !waitingForPost {
flushWaitingForPost()
}
}
/// Call to stop polling and invalidate the URLSession.
public func stopPolling() {
waitingForPoll = false
waitingForPost = false

View File

@ -25,38 +25,113 @@
import Foundation
/// Specifies a SocketEngine.
@objc public protocol SocketEngineSpec {
/// The client for this engine.
weak var client: SocketEngineClient? { get set }
/// `true` if this engine is closed.
var closed: Bool { get }
/// `true` if this engine is connected. Connected means that the initial poll connect has succeeded.
var connected: Bool { get }
/// The connect parameters sent during a connect.
var connectParams: [String: Any]? { get set }
/// Set to `true` if using the node.js version of socket.io. The node.js version of socket.io
/// handles utf8 incorrectly.
var doubleEncodeUTF8: Bool { get }
/// An array of HTTPCookies that are sent during the connection.
var cookies: [HTTPCookie]? { get }
/// The queue that all engine actions take place on.
var engineQueue: DispatchQueue { get }
/// A dictionary of extra http headers that will be set during connection.
var extraHeaders: [String: String]? { get }
/// When `true`, the engine is in the process of switching to WebSockets.
var fastUpgrade: Bool { get }
/// When `true`, the engine will only use HTTP long-polling as a transport.
var forcePolling: Bool { get }
/// When `true`, the engine will only use WebSockets as a transport.
var forceWebsockets: Bool { get }
var parseQueue: DispatchQueue { get }
/// If `true`, the engine is currently in HTTP long-polling mode.
var polling: Bool { get }
/// If `true`, the engine is currently seeing whether it can upgrade to WebSockets.
var probing: Bool { get }
var emitQueue: DispatchQueue { get }
var handleQueue: DispatchQueue { get }
/// The session id for this engine.
var sid: String { get }
/// The path to engine.io.
var socketPath: String { get }
/// The url for polling.
var urlPolling: URL { get }
/// The url for WebSockets.
var urlWebSocket: URL { get }
/// If `true`, then the engine is currently in WebSockets mode.
var websocket: Bool { get }
/// The WebSocket for this engine.
var ws: WebSocket? { get }
/// Creates a new engine.
///
/// - parameter client: The client for this engine.
/// - parameter url: The url for this engine.
/// - parameter options: The options for this engine.
init(client: SocketEngineClient, url: URL, options: NSDictionary?)
/// Starts the connection to the server.
func connect()
/// Called when an error happens during execution. Causes a disconnection.
func didError(reason: String)
/// Disconnects from the server.
///
/// - parameter reason: The reason for the disconnection. This is communicated up to the client.
func disconnect(reason: String)
/// Called to switch from HTTP long-polling to WebSockets. After calling this method the engine will be in
/// WebSocket mode.
///
/// **You shouldn't call this directly**
func doFastUpgrade()
/// Causes any packets that were waiting for POSTing to be sent through the WebSocket. This happens because when
/// the engine is attempting to upgrade to WebSocket it does not do any POSTing.
///
/// **You shouldn't call this directly**
func flushWaitingForPostToWebSocket()
/// Parses raw binary received from engine.io.
///
/// - parameter data: The data to parse.
func parseEngineData(_ data: Data)
/// Parses a raw engine.io packet.
///
/// - parameter message: The message to parse.
/// - parameter fromPolling: Whether this message is from long-polling.
/// If `true` we might have to fix utf8 encoding.
func parseEngineMessage(_ message: String, fromPolling: Bool)
/// Writes a message to engine.io, independent of transport.
///
/// - parameter msg: The message to send.
/// - parameter withType: The type of this message.
/// - parameter withData: Any data that this message has.
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data])
}
@ -64,32 +139,32 @@ extension SocketEngineSpec {
var urlPollingWithSid: URL {
var com = URLComponents(url: urlPolling, resolvingAgainstBaseURL: false)!
com.percentEncodedQuery = com.percentEncodedQuery! + "&sid=\(sid.urlEncode()!)"
return com.url!
}
var urlWebSocketWithSid: URL {
var com = URLComponents(url: urlWebSocket, resolvingAgainstBaseURL: false)!
com.percentEncodedQuery = com.percentEncodedQuery! + (sid == "" ? "" : "&sid=\(sid.urlEncode()!)")
return com.url!
}
func createBinaryDataForSend(using data: Data) -> Either<Data, String> {
if websocket {
var byteArray = [UInt8](repeating: 0x4, count: 1)
let mutData = NSMutableData(bytes: &byteArray, length: 1)
mutData.append(data)
return .left(mutData as Data)
} else {
let str = "b4" + data.base64EncodedString(options: Data.Base64EncodingOptions(rawValue: 0))
return .right(str)
}
}
func doubleEncodeUTF8(_ string: String) -> String {
if let latin1 = string.data(using: String.Encoding.utf8),
let utf8 = NSString(data: latin1, encoding: String.Encoding.isoLatin1.rawValue) {
@ -98,7 +173,7 @@ extension SocketEngineSpec {
return string
}
}
func fixDoubleUTF8(_ string: String) -> String {
if let utf8 = string.data(using: String.Encoding.isoLatin1),
let latin1 = NSString(data: utf8, encoding: String.Encoding.utf8.rawValue) {
@ -107,7 +182,7 @@ extension SocketEngineSpec {
return string
}
}
/// Send an engine message (4)
func send(_ msg: String, withData datas: [Data]) {
write(msg, withType: .message, withData: datas)

View File

@ -27,6 +27,13 @@ import Foundation
/// Protocol that is used to implement socket.io WebSocket support
public protocol SocketEngineWebsocket : SocketEngineSpec, WebSocketDelegate {
/// Sends an engine.io message through the WebSocket transport.
///
/// You shouldn't call this directly, instead call the `write` method on `SocketEngine`.
///
/// - parameter message: The message to send.
/// - parameter withType: The type of message to send.
/// - parameter withData: The data associated with this message.
func sendWebSocketMessage(_ str: String, withType type: SocketEnginePacketType, withData datas: [Data])
}
@ -37,25 +44,34 @@ extension SocketEngineWebsocket {
sendWebSocketMessage("probe", withType: .ping, withData: [])
}
}
/// Send message on WebSockets
/// Only call on emitQueue
/// Sends an engine.io message through the WebSocket transport.
///
/// You shouldn't call this directly, instead call the `write` method on `SocketEngine`.
///
/// - parameter message: The message to send.
/// - parameter withType: The type of message to send.
/// - parameter withData: The data associated with this message.
public func sendWebSocketMessage(_ str: String, withType type: SocketEnginePacketType, withData datas: [Data]) {
DefaultSocketLogger.Logger.log("Sending ws: %@ as type: %@", type: "SocketEngine", args: str, type.rawValue)
ws?.write(string: "\(type.rawValue)\(str)")
for data in datas {
if case let .left(bin) = createBinaryDataForSend(using: data) {
ws?.write(data: bin)
}
}
}
// MARK: Starscream delegate methods
/// Delegate method for when a message is received.
public func websocketDidReceiveMessage(socket: WebSocket, text: String) {
parseEngineMessage(text, fromPolling: false)
}
/// Delegate method for when binary is received.
public func websocketDidReceiveData(socket: WebSocket, data: Data) {
parseEngineData(data)
}

View File

@ -22,12 +22,22 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Dispatch
import Foundation
public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable {
/// The main class for SocketIOClientSwift.
///
/// Represents a socket.io-client. Most interaction with socket.io will be through this class.
open class SocketIOClient : NSObject, SocketIOClientSpec, SocketEngineClient, SocketParsable {
// MARK: Properties
/// The URL of the socket.io server. This is set in the initializer.
public let socketURL: URL
/// The engine for this client.
public private(set) var engine: SocketEngineSpec?
/// The status of this client.
public private(set) var status = SocketIOClientStatus.notConnected {
didSet {
switch status {
@ -37,47 +47,62 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
default:
break
}
handleClientEvent(.statusChange, data: [status])
}
}
/// If `true` then every time `connect` is called, a new engine will be created.
public var forceNew = false
/// The queue that all interaction with the client should occur on. This is the queue that event handlers are
/// called on.
public var handleQueue = DispatchQueue.main
/// The namespace for this client.
public var nsp = "/"
/// The configuration for this client.
public var config: SocketIOClientConfiguration
/// If `true`, this client will try and reconnect on any disconnects.
public var reconnects = true
/// The number of seconds to wait before attempting to reconnect.
public var reconnectWait = 10
/// The session id of this client.
public var sid: String? {
return engine?.sid
}
private let logType = "SocketIOClient"
private let parseQueue = DispatchQueue(label: "com.socketio.parseQueue")
private var anyHandler: ((SocketAnyEvent) -> Void)?
private var currentReconnectAttempt = 0
private var handlers = [SocketEventHandler]()
private var reconnecting = false
private let ackSemaphore = DispatchSemaphore(value: 1)
private(set) var currentAck = -1
private(set) var handleQueue = DispatchQueue.main
private(set) var reconnectAttempts = -1
let ackQueue = DispatchQueue(label: "com.socketio.ackQueue")
let emitQueue = DispatchQueue(label: "com.socketio.emitQueue")
var ackHandlers = SocketAckManager()
var waitingPackets = [SocketPacket]()
public var sid: String? {
return engine?.sid
}
/// Type safe way to create a new SocketIOClient. opts can be omitted
// MARK: Initializers
/// Type safe way to create a new SocketIOClient. `opts` can be omitted.
///
/// - parameter socketURL: The url of the socket.io server.
/// - parameter config: The config for this socket.
public init(socketURL: URL, config: SocketIOClientConfiguration = []) {
self.config = config
self.socketURL = socketURL
if socketURL.absoluteString.hasPrefix("https://") {
self.config.insert(.secure(true))
}
for option in config {
switch option {
case let .reconnects(reconnects):
@ -102,12 +127,15 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
}
self.config.insert(.path("/socket.io/"), replacing: false)
super.init()
}
/// Not so type safe way to create a SocketIOClient, meant for Objective-C compatiblity.
/// If using Swift it's recommended to use `init(socketURL: NSURL, options: Set<SocketIOClientOption>)`
///
/// - parameter socketURL: The url of the socket.io server.
/// - parameter config: The config for this socket.
public convenience init(socketURL: NSURL, config: NSDictionary?) {
self.init(socketURL: socketURL as URL, config: config?.toSocketConfiguration() ?? [])
}
@ -117,22 +145,28 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
engine?.disconnect(reason: "Client Deinit")
}
// MARK: Methods
private func addEngine() -> SocketEngineSpec {
DefaultSocketLogger.Logger.log("Adding engine", type: logType, args: "")
engine?.client = nil
engine = SocketEngine(client: self, url: socketURL, config: config)
return engine!
}
/// Connect to the server.
public func connect() {
open func connect() {
connect(timeoutAfter: 0, withHandler: nil)
}
/// Connect to the server. If we aren't connected after timeoutAfter, call withHandler
/// 0 Never times out
public func connect(timeoutAfter: Int, withHandler handler: (() -> Void)?) {
/// Connect to the server. If we aren't connected after `timeoutAfter` seconds, then `withHandler` is called.
///
/// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection
/// has failed. Pass 0 to never timeout.
/// - parameter withHandler: The handler to call when the client fails to connect.
open func connect(timeoutAfter: Int, withHandler handler: (() -> Void)?) {
assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)")
guard status != .connected else {
@ -147,39 +181,33 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
} else {
engine?.connect()
}
guard timeoutAfter != 0 else { return }
let time = DispatchTime.now() + Double(UInt64(timeoutAfter) * NSEC_PER_SEC) / Double(NSEC_PER_SEC)
handleQueue.asyncAfter(deadline: time) {[weak self] in
guard let this = self, this.status != .connected && this.status != .disconnected else { return }
this.status = .disconnected
this.engine?.disconnect(reason: "Connect timeout")
handler?()
}
}
private func nextAck() -> Int {
ackSemaphore.wait()
defer { ackSemaphore.signal() }
currentAck += 1
return currentAck
}
private func createOnAck(_ items: [Any]) -> OnAckCallback {
return OnAckCallback(ackNumber: nextAck(), items: items, socket: self)
currentAck += 1
return OnAckCallback(ackNumber: currentAck, items: items, socket: self)
}
func didConnect() {
DefaultSocketLogger.Logger.log("Socket connected", type: logType)
status = .connected
// Don't handle as internal because something crazy could happen where
// we disconnect before it's handled
handleEvent("connect", data: [], isInternalMessage: false)
handleClientEvent(.connect, data: [])
}
func didDisconnect(reason: String) {
@ -192,77 +220,123 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
// Make sure the engine is actually dead.
engine?.disconnect(reason: reason)
handleEvent("disconnect", data: [reason], isInternalMessage: true)
handleClientEvent(.disconnect, data: [reason])
}
/// Disconnects the socket.
public func disconnect() {
open func disconnect() {
DefaultSocketLogger.Logger.log("Closing socket", type: logType)
didDisconnect(reason: "Disconnect")
}
/// Send a message to the server
public func emit(_ event: String, _ items: SocketData...) {
emit(event, with: items)
/// Send an event to the server, with optional data items.
///
/// - parameter event: The event to send.
/// - 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() }))
} catch {
fatalError("Error creating socketRepresentation for emit: \(event), \(items)")
}
}
/// Same as emit, but meant for Objective-C
public func emit(_ event: String, with items: [Any]) {
///
/// - parameter event: The event to send.
/// - parameter with: The items to send with this event. May be left out.
open func emit(_ event: String, with items: [Any]) {
guard status == .connected else {
handleEvent("error", data: ["Tried emitting \(event) when not connected"], isInternalMessage: true)
handleClientEvent(.error, data: ["Tried emitting \(event) when not connected"])
return
}
_emit([event] + items)
}
/// Sends a message to the server, requesting an ack. Use the onAck method of SocketAckHandler to add
/// an ack.
public func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
return emitWithAck(event, with: items)
/// Sends a message to the server, requesting an ack.
///
/// **NOTE**: It is up to the server send an ack back, just calling this method does not mean the server will ack.
/// Check that your server's api will ack the event being sent.
///
/// Example:
///
/// ```swift
/// socket.emitWithAck("myEvent", 1).timingOut(after: 1) {data in
/// ...
/// }
/// ```
///
/// - parameter event: The event to send.
/// - parameter items: The items to send with this event. May be left out.
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
open func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
do {
return emitWithAck(event, with: try items.map({ try $0.socketRepresentation() }))
} catch {
fatalError("Error creating socketRepresentation for emit: \(event), \(items)")
}
}
/// Same as emitWithAck, but for Objective-C
public func emitWithAck(_ event: String, with items: [Any]) -> OnAckCallback {
///
/// **NOTE**: It is up to the server send an ack back, just calling this method does not mean the server will ack.
/// Check that your server's api will ack the event being sent.
///
/// Example:
///
/// ```swift
/// socket.emitWithAck("myEvent", with: [1]).timingOut(after: 1) {data in
/// ...
/// }
/// ```
///
/// - parameter event: The event to send.
/// - parameter with: The items to send with this event. Use `[]` to send nothing.
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
open func emitWithAck(_ event: String, with items: [Any]) -> OnAckCallback {
return createOnAck([event] + items)
}
func _emit(_ data: [Any], ack: Int? = nil) {
emitQueue.async {
guard self.status == .connected else {
self.handleEvent("error", data: ["Tried emitting when not connected"], isInternalMessage: true)
return
}
let packet = SocketPacket.packetFromEmit(data, id: ack ?? -1, nsp: self.nsp, ack: false)
let str = packet.packetString
DefaultSocketLogger.Logger.log("Emitting: %@", type: self.logType, args: str)
self.engine?.send(str, withData: packet.binary)
guard status == .connected else {
handleClientEvent(.error, data: ["Tried emitting when not connected"])
return
}
let packet = SocketPacket.packetFromEmit(data, id: ack ?? -1, nsp: nsp, ack: false)
let str = packet.packetString
DefaultSocketLogger.Logger.log("Emitting: %@", type: logType, args: str)
engine?.send(str, withData: packet.binary)
}
// If the server wants to know that the client received data
func emitAck(_ ack: Int, with items: [Any]) {
emitQueue.async {
guard self.status == .connected else { return }
let packet = SocketPacket.packetFromEmit(items, id: ack, nsp: self.nsp, ack: true)
let str = packet.packetString
DefaultSocketLogger.Logger.log("Emitting Ack: %@", type: self.logType, args: str)
self.engine?.send(str, withData: packet.binary)
guard status == .connected else { return }
let packet = SocketPacket.packetFromEmit(items, id: ack, nsp: nsp, ack: true)
let str = packet.packetString
DefaultSocketLogger.Logger.log("Emitting Ack: %@", type: logType, args: str)
engine?.send(str, withData: packet.binary)
}
/// Called when the engine closes.
///
/// - parameter reason: The reason that the engine closed.
open func engineDidClose(reason: String) {
handleQueue.async {
self._engineDidClose(reason: reason)
}
}
public func engineDidClose(reason: String) {
parseQueue.async {
self.waitingPackets.removeAll()
}
private func _engineDidClose(reason: String) {
waitingPackets.removeAll()
if status != .disconnected {
status = .notConnected
}
@ -275,14 +349,25 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
}
}
/// error
public func engineDidError(reason: String) {
/// Called when the engine errors.
///
/// - parameter reason: The reason the engine errored.
open func engineDidError(reason: String) {
handleQueue.async {
self._engineDidError(reason: reason)
}
}
private func _engineDidError(reason: String) {
DefaultSocketLogger.Logger.error("%@", type: logType, args: reason)
handleEvent("error", data: [reason], isInternalMessage: true)
handleClientEvent(.error, data: [reason])
}
public func engineDidOpen(reason: String) {
/// Called when the engine opens.
///
/// - parameter reason: The reason the engine opened.
open func engineDidOpen(reason: String) {
DefaultSocketLogger.Logger.log(reason, type: "SocketEngineClient")
}
@ -292,36 +377,45 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
DefaultSocketLogger.Logger.log("Handling ack: %@ with data: %@", type: logType, args: ack, data)
handleQueue.async() {
self.ackHandlers.executeAck(ack, with: data, onQueue: self.handleQueue)
}
ackHandlers.executeAck(ack, with: data, onQueue: handleQueue)
}
/// Causes an event to be handled. Only use if you know what you're doing.
public func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int = -1) {
/// Causes an event to be handled, and any event handlers for that event to be called.
///
/// - parameter event: The event that is to be handled.
/// - parameter data: the data associated with this event.
/// - parameter isInternalMessage: If `true` event handlers for this event will be called regardless of status.
/// - parameter withAck: The ack number for this event. May be left out.
open func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int = -1) {
guard status == .connected || isInternalMessage else { return }
DefaultSocketLogger.Logger.log("Handling event: %@ with data: %@", type: logType, args: event, data)
handleQueue.async {
self.anyHandler?(SocketAnyEvent(event: event, items: data))
anyHandler?(SocketAnyEvent(event: event, items: data))
for handler in self.handlers where handler.event == event {
handler.executeCallback(with: data, withAck: ack, withSocket: self)
}
for handler in handlers where handler.event == event {
handler.executeCallback(with: data, withAck: ack, withSocket: self)
}
}
/// Leaves nsp and goes back to /
public func leaveNamespace() {
func handleClientEvent(_ event: SocketClientEvent, data: [Any]) {
handleEvent(event.rawValue, data: data, isInternalMessage: true)
}
/// Leaves nsp and goes back to the default namespace.
open func leaveNamespace() {
if nsp != "/" {
engine?.send("1\(nsp)", withData: [])
nsp = "/"
}
}
/// Joins namespace
public func joinNamespace(_ namespace: String) {
/// Joins `namespace`.
///
/// **Do not use this to join the default namespace.** Instead call `leaveNamespace`.
///
/// - parameter namespace: The namespace to join.
open func joinNamespace(_ namespace: String) {
nsp = namespace
if nsp != "/" {
@ -330,24 +424,35 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
}
}
/// Removes handler(s) based on name
public func off(_ event: String) {
/// Removes handler(s) based on an event name.
///
/// If you wish to remove a specific event, call the `off(if:)` with the UUID received from its `on` call.
///
/// - parameter event: The event to remove handlers for.
open func off(_ event: String) {
DefaultSocketLogger.Logger.log("Removing handler for event: %@", type: logType, args: event)
handlers = handlers.filter({ $0.event != event })
}
/// Removes a handler with the specified UUID gotten from an `on` or `once`
public func off(id: UUID) {
///
/// If you want to remove all events for an event, call the off `off(_:)` method with the event name.
///
/// - parameter id: The UUID of the handler you wish to remove.
open func off(id: UUID) {
DefaultSocketLogger.Logger.log("Removing handler with id: %@", type: logType, args: id)
handlers = handlers.filter({ $0.id != id })
}
/// Adds a handler for an event.
/// Returns: A unique id for the handler
///
/// - parameter event: The event name for this handler.
/// - parameter callback: The callback that will execute when this event is received.
/// - returns: A unique id for the handler that can be used to remove it.
@discardableResult
public func on(_ event: String, callback: @escaping NormalCallback) -> UUID {
open func on(_ event: String, callback: @escaping NormalCallback) -> UUID {
DefaultSocketLogger.Logger.log("Adding handler for event: %@", type: logType, args: event)
let handler = SocketEventHandler(event: event, id: UUID(), callback: callback)
@ -356,10 +461,37 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
return handler.id
}
/// Adds a single-use handler for an event.
/// Returns: A unique id for the handler
/// Adds a handler for a client event.
///
/// Example:
///
/// ```swift
/// socket.on(clientEvent: .connect) {data, ack in
/// ...
/// }
/// ```
///
/// - parameter event: The event for this handler.
/// - parameter callback: The callback that will execute when this event is received.
/// - returns: A unique id for the handler that can be used to remove it.
@discardableResult
public func once(_ event: String, callback: @escaping NormalCallback) -> UUID {
open func on(clientEvent event: SocketClientEvent, callback: @escaping NormalCallback) -> UUID {
DefaultSocketLogger.Logger.log("Adding handler for event: %@", type: logType, args: event)
let handler = SocketEventHandler(event: event.rawValue, id: UUID(), callback: callback)
handlers.append(handler)
return handler.id
}
/// Adds a single-use handler for an event.
///
/// - parameter event: The event name for this handler.
/// - parameter callback: The callback that will execute when this event is received.
/// - returns: A unique id for the handler that can be used to remove it.
@discardableResult
open func once(_ event: String, callback: @escaping NormalCallback) -> UUID {
DefaultSocketLogger.Logger.log("Adding once handler for event: %@", type: logType, args: event)
let id = UUID()
@ -376,30 +508,40 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
}
/// Adds a handler that will be called on every event.
public func onAny(_ handler: @escaping (SocketAnyEvent) -> Void) {
///
/// - parameter handler: The callback that will execute whenever an event is received.
open func onAny(_ handler: @escaping (SocketAnyEvent) -> Void) {
anyHandler = handler
}
/// Called when the engine has a message that must be parsed.
///
/// - parameter msg: The message that needs parsing.
public func parseEngineMessage(_ msg: String) {
DefaultSocketLogger.Logger.log("Should parse message: %@", type: "SocketIOClient", args: msg)
parseQueue.async { self.parseSocketMessage(msg) }
handleQueue.async { self.parseSocketMessage(msg) }
}
/// Called when the engine receives binary data.
///
/// - parameter data: The data the engine received.
public func parseEngineBinaryData(_ data: Data) {
parseQueue.async { self.parseBinaryData(data) }
handleQueue.async { self.parseBinaryData(data) }
}
/// Tries to reconnect to the server.
public func reconnect() {
///
/// This will cause a `disconnect` event to be emitted, as well as an `reconnectAttempt` event.
open func reconnect() {
guard !reconnecting else { return }
engine?.disconnect(reason: "manual reconnect")
}
/// Removes all handlers.
/// Can be used after disconnecting to break any potential remaining retain cycles.
public func removeAllHandlers() {
open func removeAllHandlers() {
handlers.removeAll(keepingCapacity: false)
}
@ -407,8 +549,8 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
guard reconnecting else { return }
DefaultSocketLogger.Logger.log("Starting reconnect", type: logType)
handleEvent("reconnect", data: [reason], isInternalMessage: true)
handleClientEvent(.reconnect, data: [reason])
_tryReconnect()
}
@ -420,30 +562,32 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
}
DefaultSocketLogger.Logger.log("Trying to reconnect", type: logType)
handleEvent("reconnectAttempt", data: [(reconnectAttempts - currentReconnectAttempt)], isInternalMessage: true)
handleClientEvent(.reconnectAttempt, data: [(reconnectAttempts - currentReconnectAttempt)])
currentReconnectAttempt += 1
connect()
let deadline = DispatchTime.now() + Double(Int64(UInt64(reconnectWait) * NSEC_PER_SEC)) / Double(NSEC_PER_SEC)
DispatchQueue.main.asyncAfter(deadline: deadline, execute: _tryReconnect)
handleQueue.asyncAfter(deadline: DispatchTime.now() + Double(reconnectWait), execute: _tryReconnect)
}
// Test properties
var testHandlers: [SocketEventHandler] {
return handlers
}
func setTestable() {
status = .connected
}
func setTestStatus(_ status: SocketIOClientStatus) {
self.status = status
}
func setTestEngine(_ engine: SocketEngineSpec?) {
self.engine = engine
}
func emitTest(event: String, _ data: Any...) {
_emit([event] + data)
}

View File

@ -22,39 +22,56 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
/// An array-like type that holds `SocketIOClientOption`s
public struct SocketIOClientConfiguration : ExpressibleByArrayLiteral, Collection, MutableCollection {
// MARK: Typealiases
/// Type of element stored.
public typealias Element = SocketIOClientOption
/// Index type.
public typealias Index = Array<SocketIOClientOption>.Index
public typealias Generator = Array<SocketIOClientOption>.Iterator
/// Iterator type.
public typealias Iterator = Array<SocketIOClientOption>.Iterator
/// SubSequence type.
public typealias SubSequence = Array<SocketIOClientOption>.SubSequence
// MARK: Properties
private var backingArray = [SocketIOClientOption]()
/// The start index of this collection.
public var startIndex: Index {
return backingArray.startIndex
}
/// The end index of this collection.
public var endIndex: Index {
return backingArray.endIndex
}
/// Whether this collection is empty.
public var isEmpty: Bool {
return backingArray.isEmpty
}
/// The number of elements stored in this collection.
public var count: Index.Stride {
return backingArray.count
}
public var first: Generator.Element? {
/// The first element in this collection.
public var first: Element? {
return backingArray.first
}
public subscript(position: Index) -> Generator.Element {
public subscript(position: Index) -> Element {
get {
return backingArray[position]
}
set {
backingArray[position] = newValue
}
@ -64,45 +81,49 @@ public struct SocketIOClientConfiguration : ExpressibleByArrayLiteral, Collectio
get {
return backingArray[bounds]
}
set {
backingArray[bounds] = newValue
}
}
// MARK: Initializers
/// Creates a new `SocketIOClientConfiguration` from an array literal.
///
/// - parameter arrayLiteral: The elements.
public init(arrayLiteral elements: Element...) {
backingArray = elements
}
public func generate() -> Generator {
// MARK: Methods
/// Creates an iterator for this collection.
///
/// - returns: An iterator over this collection.
public func makeIterator() -> Iterator {
return backingArray.makeIterator()
}
/// - returns: The index after index.
public func index(after i: Index) -> Index {
return backingArray.index(after: i)
}
/// Special method that inserts `element` into the collection, replacing any other instances of `element`.
///
/// - parameter element: The element to insert.
/// - parameter replacing: Whether to replace any occurrences of element to the new item. Default is `true`.
public mutating func insert(_ element: Element, replacing replace: Bool = true) {
for i in 0..<backingArray.count where backingArray[i] == element {
guard replace else { return }
backingArray[i] = element
return
}
backingArray.append(element)
}
public func prefix(upTo end: Index) -> SubSequence {
return backingArray.prefix(upTo: end)
}
public func prefix(through position: Index) -> SubSequence {
return backingArray.prefix(through: position)
}
public func suffix(from start: Index) -> SubSequence {
return backingArray.suffix(from: start)
}
}

View File

@ -28,31 +28,80 @@ protocol ClientOption : CustomStringConvertible, Equatable {
func getSocketIOOptionValue() -> Any
}
/// The options for a client.
public enum SocketIOClientOption : ClientOption {
/// A dictionary of GET parameters that will be included in the connect url.
case connectParams([String: Any])
/// An array of cookies that will be sent during the initial connection.
case cookies([HTTPCookie])
/// The node.js socket.io currently does funky things to unicode when doing HTTP long-polling. Passing `true` in
/// this option causes the client to try and fix any bad unicode that might be sent.
case doubleEncodeUTF8(Bool)
/// Any extra HTTP headers that should be sent during the initial connection.
case extraHeaders([String: String])
/// If passed `true`, will cause the client to always create a new engine. Useful for debugging,
/// or when you want to be sure no state from previous engines is being carried over.
case forceNew(Bool)
/// If passed `true`, the only transport that will be used will be HTTP long-polling.
case forcePolling(Bool)
/// If passed `true`, the only transport that will be used will be WebSockets.
case forceWebsockets(Bool)
/// The queue that all interaction with the client should occur on. This is the queue that event handlers are
/// called on.
case handleQueue(DispatchQueue)
/// If passed `true`, the client will log debug information. This should be turned off in production code.
case log(Bool)
/// Used to pass in a custom logger.
case logger(SocketLogger)
/// The namespace that this client should connect to. Can be changed during use using the `joinNamespace`
/// and `leaveNamespace` methods on `SocketIOClient`.
case nsp(String)
/// A custom path to socket.io. Only use this if the socket.io server is configured to look for this path.
case path(String)
/// If passed `false`, the client will not reconnect when it loses connection. Useful if you want full control
/// over when reconnects happen.
case reconnects(Bool)
/// The number of times to try and reconnect before giving up. Pass `-1` to [never give up](https://www.youtube.com/watch?v=dQw4w9WgXcQ).
case reconnectAttempts(Int)
/// The number of seconds to wait before reconnect attempts.
case reconnectWait(Int)
/// Set `true` if your server is using secure transports.
case secure(Bool)
/// Allows you to set which certs are valid. Useful for SSL pinning.
case security(SSLSecurity)
/// If you're using a self-signed set. Only use for development.
case selfSigned(Bool)
/// Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs.
case sessionDelegate(URLSessionDelegate)
/// If passed `true`, the WebSocket transport will try and use voip logic to keep network connections open in
/// the background. **This option is experimental as socket.io shouldn't be used for background communication.**
case voipEnabled(Bool)
// MARK: Properties
/// The description of this option.
public var description: String {
let description: String
switch self {
case .connectParams:
description = "connectParams"
@ -95,13 +144,13 @@ public enum SocketIOClientOption : ClientOption {
case .voipEnabled:
description = "voipEnabled"
}
return description
}
func getSocketIOOptionValue() -> Any {
let value: Any
switch self {
case let .connectParams(params):
value = params
@ -144,11 +193,19 @@ public enum SocketIOClientOption : ClientOption {
case let .voipEnabled(enabled):
value = enabled
}
return value
}
}
public func ==(lhs: SocketIOClientOption, rhs: SocketIOClientOption) -> Bool {
return lhs.description == rhs.description
// MARK: Operators
/// Compares whether two options are the same.
///
/// - parameter lhs: Left operand to compare.
/// - parameter rhs: Right operand to compare.
/// - returns: `true` if the two are the same option.
public static func ==(lhs: SocketIOClientOption, rhs: SocketIOClientOption) -> Bool {
return lhs.description == rhs.description
}
}

View File

@ -22,22 +22,47 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Dispatch
protocol SocketIOClientSpec : class {
var handleQueue: DispatchQueue { get set }
var nsp: String { get set }
var waitingPackets: [SocketPacket] { get set }
func didConnect()
func didDisconnect(reason: String)
func didError(reason: String)
func handleAck(_ ack: Int, data: [Any])
func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int)
func handleClientEvent(_ event: SocketClientEvent, data: [Any])
func joinNamespace(_ namespace: String)
}
extension SocketIOClientSpec {
func didError(reason: String) {
DefaultSocketLogger.Logger.error("%@", type: "SocketIOClient", args: reason)
handleEvent("error", data: [reason], isInternalMessage: true, withAck: -1)
handleClientEvent(.error, data: [reason])
}
}
/// The set of events that are generated by the client.
public enum SocketClientEvent : String {
/// Emitted when the client connects. This is also called on a successful reconnection.
case connect
/// Called when the socket has disconnected and will not attempt to try to reconnect.
case disconnect
/// Called when an error occurs.
case error
/// Called when the client begins the reconnection process.
case reconnect
/// Called each time the client tries to reconnect to the server.
case reconnectAttempt
/// Called every time there is a change in the client's status.
case statusChange
}

View File

@ -24,9 +24,17 @@
import Foundation
/// **NotConnected**: initial state
///
/// **Disconnected**: connected before
/// Represents the state of the client.
@objc public enum SocketIOClientStatus : Int {
case notConnected, disconnected, connecting, connected
/// The client has never been connected. Or the client has been reset.
case notConnected
/// The client was once connected, but not anymore.
case disconnected
/// The client is in the process of connecting.
case connecting
/// The client is currently connected.
case connected
}

View File

@ -24,32 +24,47 @@
import Foundation
/// Represents a class will log client events.
public protocol SocketLogger : class {
// MARK: Properties
/// Whether to log or not
var log: Bool { get set }
// MARK: Methods
/// Normal log messages
///
/// - parameter message: The message being logged. Can include `%@` that will be replaced with `args`
/// - parameter type: The type of entity that called for logging.
/// - parameter args: Any args that should be inserted into the message. May be left out.
func log(_ message: String, type: String, args: Any...)
/// Error Messages
///
/// - parameter message: The message being logged. Can include `%@` that will be replaced with `args`
/// - parameter type: The type of entity that called for logging.
/// - parameter args: Any args that should be inserted into the message. May be left out.
func error(_ message: String, type: String, args: Any...)
}
public extension SocketLogger {
/// Default implementation.
func log(_ message: String, type: String, args: Any...) {
abstractLog("LOG", message: message, type: type, args: args)
}
/// Default implementation.
func error(_ message: String, type: String, args: Any...) {
abstractLog("ERROR", message: message, type: type, args: args)
}
private func abstractLog(_ logType: String, message: String, type: String, args: [Any]) {
guard log else { return }
let newArgs = args.map({arg -> CVarArg in String(describing: arg)})
let messageFormat = String(format: message, arguments: newArgs)
let messageFormat = String(format: message, arguments: newArgs)
NSLog("\(logType) \(type): %@", messageFormat)
}
}

View File

@ -22,12 +22,12 @@
import Foundation
protocol SocketParsable : SocketIOClientSpec {
protocol SocketParsable {
func parseBinaryData(_ data: Data)
func parseSocketMessage(_ message: String)
}
extension SocketParsable {
extension SocketParsable where Self: SocketIOClientSpec {
private func isCorrectNamespace(_ nsp: String) -> Bool {
return nsp == self.nsp
}
@ -107,8 +107,6 @@ extension SocketParsable {
}
}
var dataArray = message[message.characters.index(reader.currentIndex, offsetBy: 1)..<message.endIndex]
if type == .error && !dataArray.hasPrefix("[") && !dataArray.hasSuffix("]") {

View File

@ -24,22 +24,53 @@
import Foundation
public protocol SocketData {}
/// A marking protocol that says a type can be represented in a socket.io packet.
///
/// Example:
///
/// ```swift
/// struct CustomData : SocketData {
/// let name: String
/// let age: Int
///
/// func socketRepresentation() -> SocketData {
/// return ["name": name, "age": age]
/// }
/// }
///
/// socket.emit("myEvent", CustomData(name: "Erik", age: 24))
/// ```
public protocol SocketData {
// MARK: Methods
extension Array : SocketData {}
extension Bool : SocketData {}
extension Dictionary : SocketData {}
extension Double : SocketData {}
extension Int : SocketData {}
extension NSArray : SocketData {}
extension Data : SocketData {}
extension NSData : SocketData {}
extension NSDictionary : SocketData {}
extension NSString : SocketData {}
extension NSNull : SocketData {}
extension String : SocketData {}
/// A representation of self that can sent over socket.io.
func socketRepresentation() throws -> SocketData
}
public extension SocketData {
/// Default implementation. Only works for native Swift types and a few Foundation types.
func socketRepresentation() -> SocketData {
return self
}
}
extension Array : SocketData { }
extension Bool : SocketData { }
extension Dictionary : SocketData { }
extension Double : SocketData { }
extension Int : SocketData { }
extension NSArray : SocketData { }
extension Data : SocketData { }
extension NSData : SocketData { }
extension NSDictionary : SocketData { }
extension NSString : SocketData { }
extension NSNull : SocketData { }
extension String : SocketData { }
/// A typealias for an ack callback.
public typealias AckCallback = ([Any]) -> Void
/// A typealias for a normal callback.
public typealias NormalCallback = ([Any], SocketAckEmitter) -> Void
typealias JSON = [String: Any]

470
docs/Classes.html Normal file
View File

@ -0,0 +1,470 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="Classes Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
Classes Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Classes</h1>
<p>The following classes are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO12SocketEngine"></a>
<a name="//apple_ref/swift/Class/SocketEngine" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO12SocketEngine">SocketEngine</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The class that handles the engine.io protocol and transports.
See <code><a href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a></code> and <code><a href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a></code> for transport specific methods.</p>
<a href="Classes/SocketEngine.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">SocketEngine</span> <span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">URLSessionDelegate</span><span class="p">,</span> <span class="kt"><a href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO16SocketAckEmitter"></a>
<a name="//apple_ref/swift/Class/SocketAckEmitter" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO16SocketAckEmitter">SocketAckEmitter</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A class that represents a waiting ack call.</p>
<p><strong>NOTE</strong>: You should not store this beyond the life of the event handler.</p>
<a href="Classes/SocketAckEmitter.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">SocketAckEmitter</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO13OnAckCallback"></a>
<a name="//apple_ref/swift/Class/OnAckCallback" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO13OnAckCallback">OnAckCallback</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A class that represents an emit that will request an ack that has not yet been sent.
Call <code>timingOut(after:callback:)</code> to complete the emit
Example:</p>
<pre class="highlight swift"><code><span class="n">socket</span><span class="o">.</span><span class="nf">emitWithAck</span><span class="p">(</span><span class="s">"myEvent"</span><span class="p">)</span><span class="o">.</span><span class="nf">timingOut</span><span class="p">(</span><span class="nv">after</span><span class="p">:</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span><span class="n">data</span> <span class="k">in</span>
<span class="o">...</span>
<span class="p">}</span>
</code></pre>
<a href="Classes/OnAckCallback.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">OnAckCallback</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO14SocketIOClient"></a>
<a name="//apple_ref/swift/Class/SocketIOClient" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO14SocketIOClient">SocketIOClient</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The main class for SocketIOClientSwift.</p>
<p>Represents a socket.io-client. Most interaction with socket.io will be through this class.</p>
<a href="Classes/SocketIOClient.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">SocketIOClient</span> <span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">SocketIOClientSpec</span><span class="p">,</span> <span class="kt"><a href="Protocols/SocketEngineClient.html">SocketEngineClient</a></span><span class="p">,</span> <span class="kt">SocketParsable</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO9WebSocket"></a>
<a name="//apple_ref/swift/Class/WebSocket" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO9WebSocket">WebSocket</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Classes/WebSocket.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO7SSLCert"></a>
<a name="//apple_ref/swift/Class/SSLCert" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO7SSLCert">SSLCert</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Classes/SSLCert.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO11SSLSecurity"></a>
<a name="//apple_ref/swift/Class/SSLSecurity" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO11SSLSecurity">SSLSecurity</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Classes/SSLSecurity.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO14SocketAnyEvent"></a>
<a name="//apple_ref/swift/Class/SocketAnyEvent" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO14SocketAnyEvent">SocketAnyEvent</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Represents some event that was received.</p>
<a href="Classes/SocketAnyEvent.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">SocketAnyEvent</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:C8SocketIO19SocketClientManager"></a>
<a name="//apple_ref/swift/Class/SocketClientManager" class="dashAnchor"></a>
<a class="token" href="#/s:C8SocketIO19SocketClientManager">SocketClientManager</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Experimental socket manager.</p>
<p>API subject to change.</p>
<p>Can be used to persist sockets across ViewControllers.</p>
<p>Sockets are strongly stored, so be sure to remove them once they are no
longer needed.</p>
<p>Example usage:</p>
<pre class="highlight plaintext"><code>let manager = SocketClientManager.sharedManager
manager["room1"] = socket1
manager["room2"] = socket2
manager.removeSocket(socket: socket2)
manager["room1"]?.emit("hello")
</code></pre>
<a href="Classes/SocketClientManager.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">SocketClientManager</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,271 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>OnAckCallback Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/OnAckCallback" class="dashAnchor"></a>
<a title="OnAckCallback Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
OnAckCallback Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>OnAckCallback</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">OnAckCallback</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
<p>A class that represents an emit that will request an ack that has not yet been sent.
Call <code>timingOut(after:callback:)</code> to complete the emit
Example:</p>
<pre class="highlight swift"><code><span class="n">socket</span><span class="o">.</span><span class="nf">emitWithAck</span><span class="p">(</span><span class="s">"myEvent"</span><span class="p">)</span><span class="o">.</span><span class="nf">timingOut</span><span class="p">(</span><span class="nv">after</span><span class="p">:</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span><span class="n">data</span> <span class="k">in</span>
<span class="o">...</span>
<span class="p">}</span>
</code></pre>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Methods"></a>
<a name="//apple_ref/swift/Section/Methods" class="dashAnchor"></a>
<a href="#/Methods">
<h3 class="section-name">Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO13OnAckCallback9timingOutFT5afterSi8callbackFGSaP__T__T_"></a>
<a name="//apple_ref/swift/Method/timingOut(after:callback:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO13OnAckCallback9timingOutFT5afterSi8callbackFGSaP__T__T_">timingOut(after:callback:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Completes an emitWithAck. If this isn&rsquo;t called, the emit never happens.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">timingOut</span><span class="p">(</span><span class="n">after</span> <span class="nv">seconds</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">callback</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a></span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>after</em>
</code>
</td>
<td>
<div>
<p>The number of seconds before this emit times out if an ack hasn&rsquo;t been received.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>callback</em>
</code>
</td>
<td>
<div>
<p>The callback called when an ack is received, or when a timeout happens.
To check for timeout, use <code>SocketAckStatus</code>&lsquo;s <code>noAck</code> case.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

293
docs/Classes/SSLCert.html Normal file
View File

@ -0,0 +1,293 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SSLCert Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/SSLCert" class="dashAnchor"></a>
<a title="SSLCert Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SSLCert Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SSLCert</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO7SSLCertcFT4dataV10Foundation4Data_S0_"></a>
<a name="//apple_ref/swift/Method/init(data:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO7SSLCertcFT4dataV10Foundation4Data_S0_">init(data:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Designated init for certificates</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>data</em>
</code>
</td>
<td>
<div>
<p>is the binary data of the certificate</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>a representation security object to be used with</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO7SSLCertcFT3keyCSo6SecKey_S0_"></a>
<a name="//apple_ref/swift/Method/init(key:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO7SSLCertcFT3keyCSo6SecKey_S0_">init(key:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Designated init for public keys</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">key</span><span class="p">:</span> <span class="kt">SecKey</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>key</em>
</code>
</td>
<td>
<div>
<p>is the public key to be used</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>a representation security object to be used with</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,386 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SSLSecurity Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/SSLSecurity" class="dashAnchor"></a>
<a title="SSLSecurity Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SSLSecurity Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SSLSecurity</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO11SSLSecurity11validatedDNSb"></a>
<a name="//apple_ref/swift/Property/validatedDN" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO11SSLSecurity11validatedDNSb">validatedDN</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO11SSLSecuritycFT13usePublicKeysSb_S0_"></a>
<a name="//apple_ref/swift/Method/init(usePublicKeys:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO11SSLSecuritycFT13usePublicKeysSb_S0_">init(usePublicKeys:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Use certs from main app bundle</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">usePublicKeys</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>usePublicKeys</em>
</code>
</td>
<td>
<div>
<p>is to specific if the publicKeys or certificates should be used for SSL pinning validation</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>a representation security object to be used with</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO11SSLSecuritycFT5certsGSaCS_7SSLCert_13usePublicKeysSb_S0_"></a>
<a name="//apple_ref/swift/Method/init(certs:usePublicKeys:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO11SSLSecuritycFT5certsGSaCS_7SSLCert_13usePublicKeysSb_S0_">init(certs:usePublicKeys:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Designated init</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">certs</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/SSLCert.html">SSLCert</a></span><span class="p">],</span> <span class="nv">usePublicKeys</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>certs</em>
</code>
</td>
<td>
<div>
<p>is the certificates or public keys to use</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>usePublicKeys</em>
</code>
</td>
<td>
<div>
<p>is to specific if the publicKeys or certificates should be used for SSL pinning validation</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>a representation security object to be used with</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO11SSLSecurity7isValidFTCSo8SecTrust6domainGSqSS__Sb"></a>
<a name="//apple_ref/swift/Method/isValid(_:domain:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO11SSLSecurity7isValidFTCSo8SecTrust6domainGSqSS__Sb">isValid(_:domain:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Valid the trust and domain name.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">isValid</span><span class="p">(</span><span class="n">_</span> <span class="nv">trust</span><span class="p">:</span> <span class="kt">SecTrust</span><span class="p">,</span> <span class="nv">domain</span><span class="p">:</span> <span class="kt">String</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>trust</em>
</code>
</td>
<td>
<div>
<p>is the serverTrust to validate</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>domain</em>
</code>
</td>
<td>
<div>
<p>is the CN domain to validate</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>if the key was successfully validated</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,338 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketAckEmitter Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/SocketAckEmitter" class="dashAnchor"></a>
<a title="SocketAckEmitter Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketAckEmitter Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketAckEmitter</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">SocketAckEmitter</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
<p>A class that represents a waiting ack call.</p>
<p><strong>NOTE</strong>: You should not store this beyond the life of the event handler.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Properties"></a>
<a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
<a href="#/Properties">
<h3 class="section-name">Properties</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO16SocketAckEmitter8expectedSb"></a>
<a name="//apple_ref/swift/Property/expected" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO16SocketAckEmitter8expectedSb">expected</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If true, this handler is expecting to be acked. Call <code>with(_: SocketData...)</code> to ack.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">expected</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Methods"></a>
<a name="//apple_ref/swift/Section/Methods" class="dashAnchor"></a>
<a href="#/Methods">
<h3 class="section-name">Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO16SocketAckEmitter4withFtGSaPS_10SocketData___T_"></a>
<a name="//apple_ref/swift/Method/with(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO16SocketAckEmitter4withFtGSaPS_10SocketData___T_">with(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Call to ack receiving this event.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">with</span><span class="p">(</span><span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="kt"><a href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a></span><span class="o">...</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>items</em>
</code>
</td>
<td>
<div>
<p>A variable number of items to send when acking.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO16SocketAckEmitter4withFGSaP__T_"></a>
<a name="//apple_ref/swift/Method/with(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO16SocketAckEmitter4withFGSaP__T_">with(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Call to ack receiving this event.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">with</span><span class="p">(</span><span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>items</em>
</code>
</td>
<td>
<div>
<p>An array of items to send when acking. Use <code>[]</code> to send nothing.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,287 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketAnyEvent Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/SocketAnyEvent" class="dashAnchor"></a>
<a title="SocketAnyEvent Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketAnyEvent Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketAnyEvent</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">SocketAnyEvent</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
<p>Represents some event that was received.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Properties"></a>
<a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
<a href="#/Properties">
<h3 class="section-name">Properties</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO14SocketAnyEvent5eventSS"></a>
<a name="//apple_ref/swift/Property/event" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO14SocketAnyEvent5eventSS">event</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The event name.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO14SocketAnyEvent5itemsGSqGSaP___"></a>
<a name="//apple_ref/swift/Property/items" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO14SocketAnyEvent5itemsGSqGSaP___">items</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The data items for this event.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">items</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">]?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO14SocketAnyEvent11descriptionSS"></a>
<a name="//apple_ref/swift/Property/description" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO14SocketAnyEvent11descriptionSS">description</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The description of this event.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">override</span> <span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,475 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketClientManager Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/SocketClientManager" class="dashAnchor"></a>
<a title="SocketClientManager Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketClientManager Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketClientManager</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">SocketClientManager</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>
</div>
</div>
<p>Experimental socket manager.</p>
<p>API subject to change.</p>
<p>Can be used to persist sockets across ViewControllers.</p>
<p>Sockets are strongly stored, so be sure to remove them once they are no
longer needed.</p>
<p>Example usage:</p>
<pre class="highlight plaintext"><code>let manager = SocketClientManager.sharedManager
manager["room1"] = socket1
manager["room2"] = socket2
manager.removeSocket(socket: socket2)
manager["room1"]?.emit("hello")
</code></pre>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Properties."></a>
<a name="//apple_ref/swift/Section/Properties." class="dashAnchor"></a>
<a href="#/Properties.">
<h3 class="section-name">Properties.</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:iC8SocketIO19SocketClientManager9subscriptFSSGSqCS_14SocketIOClient_"></a>
<a name="//apple_ref/swift/Method/subscript(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:iC8SocketIO19SocketClientManager9subscriptFSSGSqCS_14SocketIOClient_">subscript(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Gets a socket by its name.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="nf">subscript</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/SocketIOClient.html">SocketIOClient</a></span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>The socket, if one had the given name.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:ZvC8SocketIO19SocketClientManager13sharedManagerS0_"></a>
<a name="//apple_ref/swift/Variable/sharedManager" class="dashAnchor"></a>
<a class="token" href="#/s:ZvC8SocketIO19SocketClientManager13sharedManagerS0_">sharedManager</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The shared manager.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">sharedManager</span> <span class="o">=</span> <span class="kt">SocketClientManager</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Methods."></a>
<a name="//apple_ref/swift/Section/Methods." class="dashAnchor"></a>
<a href="#/Methods.">
<h3 class="section-name">Methods.</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO19SocketClientManager9addSocketFTCS_14SocketIOClient9labeledAsSS_T_"></a>
<a name="//apple_ref/swift/Method/addSocket(_:labeledAs:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO19SocketClientManager9addSocketFTCS_14SocketIOClient9labeledAsSS_T_">addSocket(_:labeledAs:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Adds a socket.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">addSocket</span><span class="p">(</span><span class="n">_</span> <span class="nv">socket</span><span class="p">:</span> <span class="kt"><a href="../Classes/SocketIOClient.html">SocketIOClient</a></span><span class="p">,</span> <span class="n">labeledAs</span> <span class="nv">label</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>socket</em>
</code>
</td>
<td>
<div>
<p>The socket to add.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>labeledAs</em>
</code>
</td>
<td>
<div>
<p>The label for this socket.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO19SocketClientManager12removeSocketFT9withLabelSS_GSqCS_14SocketIOClient_"></a>
<a name="//apple_ref/swift/Method/removeSocket(withLabel:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO19SocketClientManager12removeSocketFT9withLabelSS_GSqCS_14SocketIOClient_">removeSocket(withLabel:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Removes a socket by a given name.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">removeSocket</span><span class="p">(</span><span class="n">withLabel</span> <span class="nv">label</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/SocketIOClient.html">SocketIOClient</a></span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>withLabel</em>
</code>
</td>
<td>
<div>
<p>The label of the socket to remove.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The socket for the given label, if one was present.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO19SocketClientManager12removeSocketFCS_14SocketIOClientGSqS1__"></a>
<a name="//apple_ref/swift/Method/removeSocket(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO19SocketClientManager12removeSocketFCS_14SocketIOClientGSqS1__">removeSocket(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Removes a socket.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">removeSocket</span><span class="p">(</span><span class="n">_</span> <span class="nv">socket</span><span class="p">:</span> <span class="kt"><a href="../Classes/SocketIOClient.html">SocketIOClient</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/SocketIOClient.html">SocketIOClient</a></span><span class="p">?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>socket</em>
</code>
</td>
<td>
<div>
<p>The socket to remove.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The socket if it was in the manager.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO19SocketClientManager13removeSocketsFT_T_"></a>
<a name="//apple_ref/swift/Method/removeSockets()" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO19SocketClientManager13removeSocketsFT_T_">removeSockets()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Removes all the sockets in the manager.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">removeSockets</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

911
docs/Classes/WebSocket.html Normal file
View File

@ -0,0 +1,911 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/WebSocket" class="dashAnchor"></a>
<a title="WebSocket Class Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
WebSocket Class Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>WebSocket</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:OC8SocketIO9WebSocket9CloseCode"></a>
<a name="//apple_ref/swift/Enum/CloseCode" class="dashAnchor"></a>
<a class="token" href="#/s:OC8SocketIO9WebSocket9CloseCode">CloseCode</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="../Classes/WebSocket/CloseCode.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:ZvC8SocketIO9WebSocket11ErrorDomainSS"></a>
<a name="//apple_ref/swift/Variable/ErrorDomain" class="dashAnchor"></a>
<a class="token" href="#/s:ZvC8SocketIO9WebSocket11ErrorDomainSS">ErrorDomain</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket13callbackQueueCSo13DispatchQueue"></a>
<a name="//apple_ref/swift/Property/callbackQueue" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket13callbackQueueCSo13DispatchQueue">callbackQueue</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Delegates"></a>
<a name="//apple_ref/swift/Section/Delegates" class="dashAnchor"></a>
<a href="#/Delegates">
<h3 class="section-name">Delegates</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket8delegateXwGSqPS_17WebSocketDelegate__"></a>
<a name="//apple_ref/swift/Property/delegate" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket8delegateXwGSqPS_17WebSocketDelegate__">delegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Responds to callback about new messages coming in over the WebSocket
and also connection/disconnect messages.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">delegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket12pongDelegateXwGSqPS_21WebSocketPongDelegate__"></a>
<a name="//apple_ref/swift/Property/pongDelegate" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket12pongDelegateXwGSqPS_21WebSocketPongDelegate__">pongDelegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Receives a callback for each pong message recived.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">pongDelegate</span><span class="p">:</span> <span class="kt"><a href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Block%20based%20API."></a>
<a name="//apple_ref/swift/Section/Block based API." class="dashAnchor"></a>
<a href="#/Block%20based%20API.">
<h3 class="section-name">Block based API.</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket9onConnectGSqFT_T__"></a>
<a name="//apple_ref/swift/Property/onConnect" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket9onConnectGSqFT_T__">onConnect</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket12onDisconnectGSqFGSqCSo7NSError_T__"></a>
<a name="//apple_ref/swift/Property/onDisconnect" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket12onDisconnectGSqFGSqCSo7NSError_T__">onDisconnect</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket6onTextGSqFSST__"></a>
<a name="//apple_ref/swift/Property/onText" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket6onTextGSqFSST__">onText</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket6onDataGSqFV10Foundation4DataT__"></a>
<a name="//apple_ref/swift/Property/onData" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket6onDataGSqFV10Foundation4DataT__">onData</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket6onPongGSqFGSqV10Foundation4Data_T__"></a>
<a name="//apple_ref/swift/Property/onPong" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket6onPongGSqFGSqV10Foundation4Data_T__">onPong</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket7headersGVs10DictionarySSSS_"></a>
<a name="//apple_ref/swift/Property/headers" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket7headersGVs10DictionarySSSS_">headers</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket11voipEnabledSb"></a>
<a name="//apple_ref/swift/Property/voipEnabled" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket11voipEnabledSb">voipEnabled</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket24disableSSLCertValidationSb"></a>
<a name="//apple_ref/swift/Property/disableSSLCertValidation" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket24disableSSLCertValidationSb">disableSSLCertValidation</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket8securityGSqPS_17SSLTrustValidator__"></a>
<a name="//apple_ref/swift/Property/security" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket8securityGSqPS_17SSLTrustValidator__">security</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket22enabledSSLCipherSuitesGSqGSaVs6UInt32__"></a>
<a name="//apple_ref/swift/Property/enabledSSLCipherSuites" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket22enabledSSLCipherSuitesGSqGSaVs6UInt32__">enabledSSLCipherSuites</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket6originGSqSS_"></a>
<a name="//apple_ref/swift/Property/origin" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket6originGSqSS_">origin</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket7timeoutSi"></a>
<a name="//apple_ref/swift/Property/timeout" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket7timeoutSi">timeout</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket11isConnectedSb"></a>
<a name="//apple_ref/swift/Property/isConnected" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket11isConnectedSb">isConnected</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vC8SocketIO9WebSocket10currentURLV10Foundation3URL"></a>
<a name="//apple_ref/swift/Property/currentURL" class="dashAnchor"></a>
<a class="token" href="#/s:vC8SocketIO9WebSocket10currentURLV10Foundation3URL">currentURL</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Private"></a>
<a name="//apple_ref/swift/Section/Private" class="dashAnchor"></a>
<a href="#/Private">
<h3 class="section-name">Private</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocketcFT3urlV10Foundation3URL9protocolsGSqGSaSS___S0_"></a>
<a name="//apple_ref/swift/Method/init(url:protocols:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocketcFT3urlV10Foundation3URL9protocolsGSqGSaSS___S0_">init(url:protocols:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used for setting protocols.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">url</span><span class="p">:</span> <span class="kt">URL</span><span class="p">,</span> <span class="nv">protocols</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocketcFT3urlV10Foundation3URL13writeQueueQOSOSC16QualityOfService9protocolsGSqGSaSS___S0_"></a>
<a name="//apple_ref/swift/Method/init(url:writeQueueQOS:protocols:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocketcFT3urlV10Foundation3URL13writeQueueQOSOSC16QualityOfService9protocolsGSqGSaSS___S0_">init(url:writeQueueQOS:protocols:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocket7connectFT_T_"></a>
<a name="//apple_ref/swift/Method/connect()" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocket7connectFT_T_">connect()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Connect to the WebSocket server on a background thread.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">connect</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocket10disconnectFT12forceTimeoutGSqSd_9closeCodeVs6UInt16_T_"></a>
<a name="//apple_ref/swift/Method/disconnect(forceTimeout:closeCode:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocket10disconnectFT12forceTimeoutGSqSd_9closeCodeVs6UInt16_T_">disconnect(forceTimeout:closeCode:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Disconnect from the server. I send a Close control frame to the server, then expect the server to respond with a Close control frame and close the socket from its end. I notify my delegate once the socket has been closed.
If you supply a non-nil <code>forceTimeout</code>, I wait at most that long (in seconds) for the server to close the socket. After the timeout expires, I close the socket and notify my delegate.
If you supply a zero (or negative) <code>forceTimeout</code>, I immediately close the socket (without sending a Close control frame) and notify my delegate.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">disconnect</span><span class="p">(</span><span class="nv">forceTimeout</span><span class="p">:</span> <span class="kt">TimeInterval</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">closeCode</span><span class="p">:</span> <span class="kt">UInt16</span> <span class="o">=</span> <span class="kt"><a href="../Classes/WebSocket/CloseCode.html">CloseCode</a></span><span class="o">.</span><span class="n">normal</span><span class="o">.</span><span class="n">rawValue</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>forceTimeout</em>
</code>
</td>
<td>
<div>
<p>Maximum time to wait for the server to close the socket.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>closeCode</em>
</code>
</td>
<td>
<div>
<p>The code to send on disconnect. The default is the normal close code for cleanly disconnecting a webSocket.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocket5writeFT6stringSS10completionGSqFT_T___T_"></a>
<a name="//apple_ref/swift/Method/write(string:completion:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocket5writeFT6stringSS10completionGSqFT_T___T_">write(string:completion:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Write a string to the websocket. This sends it as a text frame.
If you supply a non-nil completion block, I will perform it when the write completes.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-&gt;</span> <span class="p">())?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>string</em>
</code>
</td>
<td>
<div>
<p>The string to write.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>completion</em>
</code>
</td>
<td>
<div>
<p>The (optional) completion handler.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocket5writeFT4dataV10Foundation4Data10completionGSqFT_T___T_"></a>
<a name="//apple_ref/swift/Method/write(data:completion:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocket5writeFT4dataV10Foundation4Data10completionGSqFT_T___T_">write(data:completion:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Write binary data to the websocket. This sends it as a binary frame.
If you supply a non-nil completion block, I will perform it when the write completes.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-&gt;</span> <span class="p">())?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>data</em>
</code>
</td>
<td>
<div>
<p>The data to write.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>completion</em>
</code>
</td>
<td>
<div>
<p>The (optional) completion handler.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocket5writeFT4pingV10Foundation4Data10completionGSqFT_T___T_"></a>
<a name="//apple_ref/swift/Method/write(ping:completion:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocket5writeFT4pingV10Foundation4Data10completionGSqFT_T___T_">write(ping:completion:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Write a ping to the websocket. This sends it as a control frame.
Yodel a sound to the planet. This sends it as an astroid. <a href="http://youtu.be/Eu5ZJELRiJ8?t=42s">http://youtu.be/Eu5ZJELRiJ8?t=42s</a></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="nv">ping</span><span class="p">:</span> <span class="kt">Data</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-&gt;</span> <span class="p">())?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FC8SocketIO9WebSocket6streamFTCSo6Stream6handleVS1_5Event_T_"></a>
<a name="//apple_ref/swift/Method/stream(_:handle:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC8SocketIO9WebSocket6streamFTCSo6Stream6handleVS1_5Event_T_">stream(_:handle:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Delegate for the stream methods. Processes incoming bytes</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">stream</span><span class="p">(</span><span class="n">_</span> <span class="nv">aStream</span><span class="p">:</span> <span class="kt">Stream</span><span class="p">,</span> <span class="n">handle</span> <span class="nv">eventCode</span><span class="p">:</span> <span class="kt">Stream</span><span class="o">.</span><span class="kt">Event</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,373 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>CloseCode Enum Reference</title>
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
<meta charset="utf-8">
<script src="../../js/jquery.min.js" defer></script>
<script src="../../js/jazzy.js" defer></script>
<script src="../../js/lunr.min.js" defer></script>
<script src="../../js/typeahead.jquery.js" defer></script>
<script src="../../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/CloseCode" class="dashAnchor"></a>
<a title="CloseCode Enum Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../../index.html">SocketIO Reference</a>
<img class="carat" src="../../img/carat.png" />
CloseCode Enum Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>CloseCode</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode6normalFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/normal" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode6normalFMS1_S1_">normal</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode9goingAwayFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/goingAway" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode9goingAwayFMS1_S1_">goingAway</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode13protocolErrorFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/protocolError" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode13protocolErrorFMS1_S1_">protocolError</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode21protocolUnhandledTypeFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/protocolUnhandledType" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode21protocolUnhandledTypeFMS1_S1_">protocolUnhandledType</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode16noStatusReceivedFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/noStatusReceived" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode16noStatusReceivedFMS1_S1_">noStatusReceived</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode8encodingFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/encoding" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode8encodingFMS1_S1_">encoding</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode14policyViolatedFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/policyViolated" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode14policyViolatedFMS1_S1_">policyViolated</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FOC8SocketIO9WebSocket9CloseCode13messageTooBigFMS1_S1_"></a>
<a name="//apple_ref/swift/Element/messageTooBig" class="dashAnchor"></a>
<a class="token" href="#/s:FOC8SocketIO9WebSocket9CloseCode13messageTooBigFMS1_S1_">messageTooBig</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

316
docs/Enums.html Normal file
View File

@ -0,0 +1,316 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Enums Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="Enums Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
Enums Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Enums</h1>
<p>The following enums are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:O8SocketIO20SocketIOClientStatus"></a>
<a name="//apple_ref/swift/Enum/SocketIOClientStatus" class="dashAnchor"></a>
<a class="token" href="#/s:O8SocketIO20SocketIOClientStatus">SocketIOClientStatus</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Represents the state of the client.</p>
<a href="Enums/SocketIOClientStatus.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketIOClientStatus</span> <span class="p">:</span> <span class="kt">Int</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:O8SocketIO15SocketAckStatus"></a>
<a name="//apple_ref/swift/Enum/SocketAckStatus" class="dashAnchor"></a>
<a class="token" href="#/s:O8SocketIO15SocketAckStatus">SocketAckStatus</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The status of an ack.</p>
<a href="Enums/SocketAckStatus.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketAckStatus</span> <span class="p">:</span> <span class="kt">String</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:O8SocketIO22SocketEnginePacketType"></a>
<a name="//apple_ref/swift/Enum/SocketEnginePacketType" class="dashAnchor"></a>
<a class="token" href="#/s:O8SocketIO22SocketEnginePacketType">SocketEnginePacketType</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Represents the type of engine.io packet types.</p>
<a href="Enums/SocketEnginePacketType.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketEnginePacketType</span> <span class="p">:</span> <span class="kt">Int</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:O8SocketIO20SocketIOClientOption"></a>
<a name="//apple_ref/swift/Enum/SocketIOClientOption" class="dashAnchor"></a>
<a class="token" href="#/s:O8SocketIO20SocketIOClientOption">SocketIOClientOption</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The options for a client.</p>
<a href="Enums/SocketIOClientOption.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketIOClientOption</span> <span class="p">:</span> <span class="kt">ClientOption</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketAckStatus Enum Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/SocketAckStatus" class="dashAnchor"></a>
<a title="SocketAckStatus Enum Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketAckStatus Enum Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketAckStatus</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketAckStatus</span> <span class="p">:</span> <span class="kt">String</span></code></pre>
</div>
</div>
<p>The status of an ack.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO15SocketAckStatus5noAckFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/noAck" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO15SocketAckStatus5noAckFMS0_S0_">noAck</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The ack timed out.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">noAck</span> <span class="o">=</span> <span class="s">"NO ACK"</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,412 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketEnginePacketType Enum Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/SocketEnginePacketType" class="dashAnchor"></a>
<a title="SocketEnginePacketType Enum Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketEnginePacketType Enum Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketEnginePacketType</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketEnginePacketType</span> <span class="p">:</span> <span class="kt">Int</span></code></pre>
</div>
</div>
<p>Represents the type of engine.io packet types.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType4openFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/open" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType4openFMS0_S0_">open</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Open message.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">open</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType5closeFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/close" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType5closeFMS0_S0_">close</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Close message.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">close</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType4pingFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/ping" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType4pingFMS0_S0_">ping</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Ping message.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">ping</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType4pongFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/pong" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType4pongFMS0_S0_">pong</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Pong message.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">pong</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType7messageFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/message" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType7messageFMS0_S0_">message</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Regular message.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">message</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType7upgradeFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/upgrade" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType7upgradeFMS0_S0_">upgrade</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Upgrade message.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">upgrade</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO22SocketEnginePacketType4noopFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/noop" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO22SocketEnginePacketType4noopFMS0_S0_">noop</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>NOOP.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">noop</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,932 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketIOClientOption Enum Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/SocketIOClientOption" class="dashAnchor"></a>
<a title="SocketIOClientOption Enum Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketIOClientOption Enum Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketIOClientOption</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketIOClientOption</span> <span class="p">:</span> <span class="kt">ClientOption</span></code></pre>
</div>
</div>
<p>The options for a client.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption13connectParamsFMS0_FGVs10DictionarySSP__S0_"></a>
<a name="//apple_ref/swift/Element/connectParams" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption13connectParamsFMS0_FGVs10DictionarySSP__S0_">connectParams</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A dictionary of GET parameters that will be included in the connect url.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">connectParams</span><span class="p">([</span><span class="kt">String</span><span class="p">:</span> <span class="kt">Any</span><span class="p">])</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption7cookiesFMS0_FGSaCSo10HTTPCookie_S0_"></a>
<a name="//apple_ref/swift/Element/cookies" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption7cookiesFMS0_FGSaCSo10HTTPCookie_S0_">cookies</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>An array of cookies that will be sent during the initial connection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">cookies</span><span class="p">([</span><span class="kt">HTTPCookie</span><span class="p">])</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption16doubleEncodeUTF8FMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/doubleEncodeUTF8" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption16doubleEncodeUTF8FMS0_FSbS0_">doubleEncodeUTF8</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The node.js socket.io currently does funky things to unicode when doing HTTP long-polling. Passing <code>true</code> in
this option causes the client to try and fix any bad unicode that might be sent.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">doubleEncodeUTF8</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption12extraHeadersFMS0_FGVs10DictionarySSSS_S0_"></a>
<a name="//apple_ref/swift/Element/extraHeaders" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption12extraHeadersFMS0_FGVs10DictionarySSSS_S0_">extraHeaders</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Any extra HTTP headers that should be sent during the initial connection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">extraHeaders</span><span class="p">([</span><span class="kt">String</span><span class="p">:</span> <span class="kt">String</span><span class="p">])</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption8forceNewFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/forceNew" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption8forceNewFMS0_FSbS0_">forceNew</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If passed <code>true</code>, will cause the client to always create a new engine. Useful for debugging,
or when you want to be sure no state from previous engines is being carried over.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">forceNew</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption12forcePollingFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/forcePolling" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption12forcePollingFMS0_FSbS0_">forcePolling</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If passed <code>true</code>, the only transport that will be used will be HTTP long-polling.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">forcePolling</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption15forceWebsocketsFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/forceWebsockets" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption15forceWebsocketsFMS0_FSbS0_">forceWebsockets</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If passed <code>true</code>, the only transport that will be used will be WebSockets.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">forceWebsockets</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption11handleQueueFMS0_FCSo13DispatchQueueS0_"></a>
<a name="//apple_ref/swift/Element/handleQueue" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption11handleQueueFMS0_FCSo13DispatchQueueS0_">handleQueue</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The queue that all interaction with the client should occur on. This is the queue that event handlers are
called on.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">handleQueue</span><span class="p">(</span><span class="kt">DispatchQueue</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption3logFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/log" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption3logFMS0_FSbS0_">log</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If passed <code>true</code>, the client will log debug information. This should be turned off in production code.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">log</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption6loggerFMS0_FPS_12SocketLogger_S0_"></a>
<a name="//apple_ref/swift/Element/logger" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption6loggerFMS0_FPS_12SocketLogger_S0_">logger</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used to pass in a custom logger.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">logger</span><span class="p">(</span><span class="kt"><a href="../Protocols/SocketLogger.html">SocketLogger</a></span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption3nspFMS0_FSSS0_"></a>
<a name="//apple_ref/swift/Element/nsp" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption3nspFMS0_FSSS0_">nsp</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The namespace that this client should connect to. Can be changed during use using the <code>joinNamespace</code>
and <code>leaveNamespace</code> methods on <code><a href="../Classes/SocketIOClient.html">SocketIOClient</a></code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">nsp</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption4pathFMS0_FSSS0_"></a>
<a name="//apple_ref/swift/Element/path" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption4pathFMS0_FSSS0_">path</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A custom path to socket.io. Only use this if the socket.io server is configured to look for this path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">path</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption10reconnectsFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/reconnects" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption10reconnectsFMS0_FSbS0_">reconnects</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If passed <code>false</code>, the client will not reconnect when it loses connection. Useful if you want full control
over when reconnects happen.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">reconnects</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption17reconnectAttemptsFMS0_FSiS0_"></a>
<a name="//apple_ref/swift/Element/reconnectAttempts" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption17reconnectAttemptsFMS0_FSiS0_">reconnectAttempts</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The number of times to try and reconnect before giving up. Pass <code>-1</code> to <a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">never give up</a>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">reconnectAttempts</span><span class="p">(</span><span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption13reconnectWaitFMS0_FSiS0_"></a>
<a name="//apple_ref/swift/Element/reconnectWait" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption13reconnectWaitFMS0_FSiS0_">reconnectWait</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The number of seconds to wait before reconnect attempts.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">reconnectWait</span><span class="p">(</span><span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption6secureFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/secure" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption6secureFMS0_FSbS0_">secure</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Set <code>true</code> if your server is using secure transports.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">secure</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption8securityFMS0_FCS_11SSLSecurityS0_"></a>
<a name="//apple_ref/swift/Element/security" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption8securityFMS0_FCS_11SSLSecurityS0_">security</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Allows you to set which certs are valid. Useful for SSL pinning.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">security</span><span class="p">(</span><span class="kt"><a href="../Classes/SSLSecurity.html">SSLSecurity</a></span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption10selfSignedFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/selfSigned" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption10selfSignedFMS0_FSbS0_">selfSigned</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If you&rsquo;re using a self-signed set. Only use for development.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">selfSigned</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption15sessionDelegateFMS0_FPSo18URLSessionDelegate_S0_"></a>
<a name="//apple_ref/swift/Element/sessionDelegate" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption15sessionDelegateFMS0_FPSo18URLSessionDelegate_S0_">sessionDelegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">sessionDelegate</span><span class="p">(</span><span class="kt">URLSessionDelegate</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientOption11voipEnabledFMS0_FSbS0_"></a>
<a name="//apple_ref/swift/Element/voipEnabled" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientOption11voipEnabledFMS0_FSbS0_">voipEnabled</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>If passed <code>true</code>, the WebSocket transport will try and use voip logic to keep network connections open in
the background. <strong>This option is experimental as socket.io shouldn&rsquo;t be used for background communication.</strong></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="nf">voipEnabled</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Properties"></a>
<a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
<a href="#/Properties">
<h3 class="section-name">Properties</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vO8SocketIO20SocketIOClientOption11descriptionSS"></a>
<a name="//apple_ref/swift/Property/description" class="dashAnchor"></a>
<a class="token" href="#/s:vO8SocketIO20SocketIOClientOption11descriptionSS">description</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The description of this option.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Operators"></a>
<a name="//apple_ref/swift/Section/Operators" class="dashAnchor"></a>
<a href="#/Operators">
<h3 class="section-name">Operators</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:ZFO8SocketIO20SocketIOClientOptionoi2eeFTS0_S0__Sb"></a>
<a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
<a class="token" href="#/s:ZFO8SocketIO20SocketIOClientOptionoi2eeFTS0_S0__Sb">==(_:_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Compares whether two options are the same.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">SocketIOClientOption</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">SocketIOClientOption</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>lhs</em>
</code>
</td>
<td>
<div>
<p>Left operand to compare.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>rhs</em>
</code>
</td>
<td>
<div>
<p>Right operand to compare.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p><code>true</code> if the two are the same option.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,319 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketIOClientStatus Enum Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/SocketIOClientStatus" class="dashAnchor"></a>
<a title="SocketIOClientStatus Enum Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketIOClientStatus Enum Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketIOClientStatus</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">enum</span> <span class="kt">SocketIOClientStatus</span> <span class="p">:</span> <span class="kt">Int</span></code></pre>
</div>
</div>
<p>Represents the state of the client.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientStatus12notConnectedFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/notConnected" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientStatus12notConnectedFMS0_S0_">notConnected</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The client has never been connected. Or the client has been reset.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">notConnected</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientStatus12disconnectedFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/disconnected" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientStatus12disconnectedFMS0_S0_">disconnected</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The client was once connected, but not anymore.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">disconnected</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientStatus10connectingFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/connecting" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientStatus10connectingFMS0_S0_">connecting</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The client is in the process of connecting.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">connecting</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FO8SocketIO20SocketIOClientStatus9connectedFMS0_S0_"></a>
<a name="//apple_ref/swift/Element/connected" class="dashAnchor"></a>
<a class="token" href="#/s:FO8SocketIO20SocketIOClientStatus9connectedFMS0_S0_">connected</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The client is currently connected.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">case</span> <span class="n">connected</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

249
docs/Global Variables.html Normal file
View File

@ -0,0 +1,249 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Global Variables Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="Global Variables Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
Global Variables Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Global Variables</h1>
<p>The following global variables are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:v8SocketIO31WebsocketDidConnectNotificationSS"></a>
<a name="//apple_ref/swift/Global/WebsocketDidConnectNotification" class="dashAnchor"></a>
<a class="token" href="#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:v8SocketIO34WebsocketDidDisconnectNotificationSS"></a>
<a name="//apple_ref/swift/Global/WebsocketDidDisconnectNotification" class="dashAnchor"></a>
<a class="token" href="#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS"></a>
<a name="//apple_ref/swift/Global/WebsocketDisconnectionErrorKeyName" class="dashAnchor"></a>
<a class="token" href="#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

447
docs/Protocols.html Normal file
View File

@ -0,0 +1,447 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Protocols Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="Protocols Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
Protocols Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Protocols</h1>
<p>The following protocols are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO21SocketEngineWebsocket"></a>
<a name="//apple_ref/swift/Protocol/SocketEngineWebsocket" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO21SocketEngineWebsocket">SocketEngineWebsocket</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Protocol that is used to implement socket.io WebSocket support</p>
<a href="Protocols/SocketEngineWebsocket.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEngineWebsocket</span> <span class="p">:</span> <span class="kt"><a href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a></span><span class="p">,</span> <span class="kt"><a href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO20SocketEnginePollable"></a>
<a name="//apple_ref/swift/Protocol/SocketEnginePollable" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO20SocketEnginePollable">SocketEnginePollable</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Protocol that is used to implement socket.io polling support</p>
<a href="Protocols/SocketEnginePollable.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEnginePollable</span> <span class="p">:</span> <span class="kt"><a href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO16SocketEngineSpec"></a>
<a name="//apple_ref/swift/Protocol/SocketEngineSpec" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO16SocketEngineSpec">SocketEngineSpec</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Specifies a SocketEngine.</p>
<a href="Protocols/SocketEngineSpec.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEngineSpec</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO10SocketData"></a>
<a name="//apple_ref/swift/Protocol/SocketData" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO10SocketData">SocketData</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A marking protocol that says a type can be represented in a socket.io packet.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketData</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO12SocketLogger"></a>
<a name="//apple_ref/swift/Protocol/SocketLogger" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO12SocketLogger">SocketLogger</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Represents a class will log client events.</p>
<a href="Protocols/SocketLogger.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketLogger</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO17WebSocketDelegate"></a>
<a name="//apple_ref/swift/Protocol/WebSocketDelegate" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO17WebSocketDelegate">WebSocketDelegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Protocols/WebSocketDelegate.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO21WebSocketPongDelegate"></a>
<a name="//apple_ref/swift/Protocol/WebSocketPongDelegate" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO21WebSocketPongDelegate">WebSocketPongDelegate</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Protocols/WebSocketPongDelegate.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO18SocketEngineClient"></a>
<a name="//apple_ref/swift/Protocol/SocketEngineClient" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO18SocketEngineClient">SocketEngineClient</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Declares that a type will be a delegate to an engine.</p>
<a href="Protocols/SocketEngineClient.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEngineClient</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:P8SocketIO17SSLTrustValidator"></a>
<a name="//apple_ref/swift/Protocol/SSLTrustValidator" class="dashAnchor"></a>
<a class="token" href="#/s:P8SocketIO17SSLTrustValidator">SSLTrustValidator</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<a href="Protocols/SSLTrustValidator.html" class="slightly-smaller">See more</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,212 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SSLTrustValidator Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/SSLTrustValidator" class="dashAnchor"></a>
<a title="SSLTrustValidator Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SSLTrustValidator Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SSLTrustValidator</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO17SSLTrustValidator7isValidFTCSo8SecTrust6domainGSqSS__Sb"></a>
<a name="//apple_ref/swift/Method/isValid(_:domain:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO17SSLTrustValidator7isValidFTCSo8SecTrust6domainGSqSS__Sb">isValid(_:domain:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,436 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketEngineClient Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/SocketEngineClient" class="dashAnchor"></a>
<a title="SocketEngineClient Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketEngineClient Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketEngineClient</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">@objc</span> <span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEngineClient</span></code></pre>
</div>
</div>
<p>Declares that a type will be a delegate to an engine.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Methods"></a>
<a name="//apple_ref/swift/Section/Methods" class="dashAnchor"></a>
<a href="#/Methods">
<h3 class="section-name">Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO18SocketEngineClient14engineDidErrorFT6reasonSS_T_"></a>
<a name="//apple_ref/swift/Method/engineDidError(reason:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO18SocketEngineClient14engineDidErrorFT6reasonSS_T_">engineDidError(reason:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Called when the engine errors.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">engineDidError</span><span class="p">(</span><span class="nv">reason</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>reason</em>
</code>
</td>
<td>
<div>
<p>The reason the engine errored.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO18SocketEngineClient14engineDidCloseFT6reasonSS_T_"></a>
<a name="//apple_ref/swift/Method/engineDidClose(reason:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO18SocketEngineClient14engineDidCloseFT6reasonSS_T_">engineDidClose(reason:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Called when the engine closes.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">engineDidClose</span><span class="p">(</span><span class="nv">reason</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>reason</em>
</code>
</td>
<td>
<div>
<p>The reason that the engine closed.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO18SocketEngineClient13engineDidOpenFT6reasonSS_T_"></a>
<a name="//apple_ref/swift/Method/engineDidOpen(reason:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO18SocketEngineClient13engineDidOpenFT6reasonSS_T_">engineDidOpen(reason:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Called when the engine opens.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">engineDidOpen</span><span class="p">(</span><span class="nv">reason</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>reason</em>
</code>
</td>
<td>
<div>
<p>The reason the engine opened.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO18SocketEngineClient18parseEngineMessageFSST_"></a>
<a name="//apple_ref/swift/Method/parseEngineMessage(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO18SocketEngineClient18parseEngineMessageFSST_">parseEngineMessage(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Called when the engine has a message that must be parsed.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">parseEngineMessage</span><span class="p">(</span><span class="n">_</span> <span class="nv">msg</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>msg</em>
</code>
</td>
<td>
<div>
<p>The message that needs parsing.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO18SocketEngineClient21parseEngineBinaryDataFV10Foundation4DataT_"></a>
<a name="//apple_ref/swift/Method/parseEngineBinaryData(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO18SocketEngineClient21parseEngineBinaryDataFV10Foundation4DataT_">parseEngineBinaryData(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Called when the engine receives binary data.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">parseEngineBinaryData</span><span class="p">(</span><span class="n">_</span> <span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>data</em>
</code>
</td>
<td>
<div>
<p>The data the engine received.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,499 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketEnginePollable Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/SocketEnginePollable" class="dashAnchor"></a>
<a title="SocketEnginePollable Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketEnginePollable Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketEnginePollable</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEnginePollable</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a></span></code></pre>
</div>
</div>
<p>Protocol that is used to implement socket.io polling support</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vP8SocketIO20SocketEnginePollable11invalidatedSb"></a>
<a name="//apple_ref/swift/Property/invalidated" class="dashAnchor"></a>
<a class="token" href="#/s:vP8SocketIO20SocketEnginePollable11invalidatedSb">invalidated</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>MARK: Properties
<code>true</code> If engine&rsquo;s session has been invalidated.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">invalidated</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vP8SocketIO20SocketEnginePollable8postWaitGSaSS_"></a>
<a name="//apple_ref/swift/Property/postWait" class="dashAnchor"></a>
<a class="token" href="#/s:vP8SocketIO20SocketEnginePollable8postWaitGSaSS_">postWait</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A queue of engine.io messages waiting for POSTing</p>
<p><strong>You should not touch this directly</strong></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">postWait</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">]</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vP8SocketIO20SocketEnginePollable7sessionGSqCSo10URLSession_"></a>
<a name="//apple_ref/swift/Property/session" class="dashAnchor"></a>
<a class="token" href="#/s:vP8SocketIO20SocketEnginePollable7sessionGSqCSo10URLSession_">session</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The URLSession that will be used for polling.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">session</span><span class="p">:</span> <span class="kt">URLSession</span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vP8SocketIO20SocketEnginePollable14waitingForPollSb"></a>
<a name="//apple_ref/swift/Property/waitingForPoll" class="dashAnchor"></a>
<a class="token" href="#/s:vP8SocketIO20SocketEnginePollable14waitingForPollSb">waitingForPoll</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>true</code> if there is an outstanding poll. Trying to poll before the first is done will cause socket.io to
disconnect us.</p>
<p><strong>Do not touch this directly</strong></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">waitingForPoll</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vP8SocketIO20SocketEnginePollable14waitingForPostSb"></a>
<a name="//apple_ref/swift/Property/waitingForPost" class="dashAnchor"></a>
<a class="token" href="#/s:vP8SocketIO20SocketEnginePollable14waitingForPostSb">waitingForPost</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p><code>true</code> if there is an outstanding post. Trying to post before the first is done will cause socket.io to
disconnect us.</p>
<p><strong>Do not touch this directly</strong></p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">waitingForPost</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO20SocketEnginePollable6doPollFT_T_"></a>
<a name="//apple_ref/swift/Method/doPoll()" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO20SocketEnginePollable6doPollFT_T_">doPoll()</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Call to send a long-polling request.</p>
<p>You shouldn&rsquo;t need to call this directly, the engine should automatically maintain a long-poll request.</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
<p>Call to send a long-polling request.</p>
<p>You shouldn&rsquo;t need to call this directly, the engine should automatically maintain a long-poll request.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">doPoll</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO20SocketEnginePollable15sendPollMessageFTSS8withTypeOS_22SocketEnginePacketType8withDataGSaV10Foundation4Data__T_"></a>
<a name="//apple_ref/swift/Method/sendPollMessage(_:withType:withData:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO20SocketEnginePollable15sendPollMessageFTSS8withTypeOS_22SocketEnginePacketType8withDataGSaV10Foundation4Data__T_">sendPollMessage(_:withType:withData:)</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sends an engine.io message through the polling transport.</p>
<p>You shouldn&rsquo;t call this directly, instead call the <code>write</code> method on <code><a href="../Classes/SocketEngine.html">SocketEngine</a></code>.</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
<p>Sends an engine.io message through the polling transport.</p>
<p>You shouldn&rsquo;t call this directly, instead call the <code>write</code> method on <code>SocketEngine</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sendPollMessage</span><span class="p">(</span><span class="n">_</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">withType</span> <span class="nv">type</span><span class="p">:</span> <span class="kt"><a href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a></span><span class="p">,</span> <span class="n">withData</span> <span class="nv">datas</span><span class="p">:</span> <span class="p">[</span><span class="kt">Data</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>The message to send.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>withType</em>
</code>
</td>
<td>
<div>
<p>The type of message to send.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>withData</em>
</code>
</td>
<td>
<div>
<p>The data associated with this message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO20SocketEnginePollable11stopPollingFT_T_"></a>
<a name="//apple_ref/swift/Method/stopPolling()" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO20SocketEnginePollable11stopPollingFT_T_">stopPolling()</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Call to stop polling and invalidate the URLSession.</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
<p>Call to stop polling and invalidate the URLSession.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">stopPolling</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,352 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketEngineWebsocket Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/SocketEngineWebsocket" class="dashAnchor"></a>
<a title="SocketEngineWebsocket Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketEngineWebsocket Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketEngineWebsocket</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketEngineWebsocket</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a></span><span class="p">,</span> <span class="kt"><a href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a></span></code></pre>
</div>
</div>
<p>Protocol that is used to implement socket.io WebSocket support</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO21SocketEngineWebsocket20sendWebSocketMessageFTSS8withTypeOS_22SocketEnginePacketType8withDataGSaV10Foundation4Data__T_"></a>
<a name="//apple_ref/swift/Method/sendWebSocketMessage(_:withType:withData:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO21SocketEngineWebsocket20sendWebSocketMessageFTSS8withTypeOS_22SocketEnginePacketType8withDataGSaV10Foundation4Data__T_">sendWebSocketMessage(_:withType:withData:)</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Sends an engine.io message through the WebSocket transport.</p>
<p>You shouldn&rsquo;t call this directly, instead call the <code>write</code> method on <code><a href="../Classes/SocketEngine.html">SocketEngine</a></code>.</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
<p>Sends an engine.io message through the WebSocket transport.</p>
<p>You shouldn&rsquo;t call this directly, instead call the <code>write</code> method on <code>SocketEngine</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">sendWebSocketMessage</span><span class="p">(</span><span class="n">_</span> <span class="nv">str</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">withType</span> <span class="nv">type</span><span class="p">:</span> <span class="kt"><a href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a></span><span class="p">,</span> <span class="n">withData</span> <span class="nv">datas</span><span class="p">:</span> <span class="p">[</span><span class="kt">Data</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>The message to send.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>withType</em>
</code>
</td>
<td>
<div>
<p>The type of message to send.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>withData</em>
</code>
</td>
<td>
<div>
<p>The data associated with this message.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Starscream%20delegate%20methods"></a>
<a name="//apple_ref/swift/Section/Starscream delegate methods" class="dashAnchor"></a>
<a href="#/Starscream%20delegate%20methods">
<h3 class="section-name">Starscream delegate methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FE8SocketIOPS_21SocketEngineWebsocket26websocketDidReceiveMessageFT6socketCS_9WebSocket4textSS_T_"></a>
<a name="//apple_ref/swift/Method/websocketDidReceiveMessage(socket:text:)" class="dashAnchor"></a>
<a class="token" href="#/s:FE8SocketIOPS_21SocketEngineWebsocket26websocketDidReceiveMessageFT6socketCS_9WebSocket4textSS_T_">websocketDidReceiveMessage(socket:text:)</a>
</code>
<span class="declaration-note">
Extension method
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Delegate method for when a message is received.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">websocketDidReceiveMessage</span><span class="p">(</span><span class="nv">socket</span><span class="p">:</span> <span class="kt"><a href="../Classes/WebSocket.html">WebSocket</a></span><span class="p">,</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FE8SocketIOPS_21SocketEngineWebsocket23websocketDidReceiveDataFT6socketCS_9WebSocket4dataV10Foundation4Data_T_"></a>
<a name="//apple_ref/swift/Method/websocketDidReceiveData(socket:data:)" class="dashAnchor"></a>
<a class="token" href="#/s:FE8SocketIOPS_21SocketEngineWebsocket23websocketDidReceiveDataFT6socketCS_9WebSocket4dataV10Foundation4Data_T_">websocketDidReceiveData(socket:data:)</a>
</code>
<span class="declaration-note">
Extension method
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Delegate method for when binary is received.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">websocketDidReceiveData</span><span class="p">(</span><span class="nv">socket</span><span class="p">:</span> <span class="kt"><a href="../Classes/WebSocket.html">WebSocket</a></span><span class="p">,</span> <span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,400 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketLogger Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/SocketLogger" class="dashAnchor"></a>
<a title="SocketLogger Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketLogger Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketLogger</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketLogger</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
</div>
</div>
<p>Represents a class will log client events.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Properties"></a>
<a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
<a href="#/Properties">
<h3 class="section-name">Properties</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vP8SocketIO12SocketLogger3logSb"></a>
<a name="//apple_ref/swift/Property/log" class="dashAnchor"></a>
<a class="token" href="#/s:vP8SocketIO12SocketLogger3logSb">log</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Whether to log or not</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">log</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Methods"></a>
<a name="//apple_ref/swift/Section/Methods" class="dashAnchor"></a>
<a href="#/Methods">
<h3 class="section-name">Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO12SocketLogger3logFtSS4typeSS4argsGSaP___T_"></a>
<a name="//apple_ref/swift/Method/log(_:type:args:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO12SocketLogger3logFtSS4typeSS4argsGSaP___T_">log(_:type:args:)</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Normal log messages</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
<p>Default implementation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">log</span><span class="p">(</span><span class="n">_</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">args</span><span class="p">:</span> <span class="kt">Any</span><span class="o">...</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>The message being logged. Can include <code>%@</code> that will be replaced with <code>args</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>type</em>
</code>
</td>
<td>
<div>
<p>The type of entity that called for logging.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>args</em>
</code>
</td>
<td>
<div>
<p>Any args that should be inserted into the message. May be left out.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO12SocketLogger5errorFtSS4typeSS4argsGSaP___T_"></a>
<a name="//apple_ref/swift/Method/error(_:type:args:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO12SocketLogger5errorFtSS4typeSS4argsGSaP___T_">error(_:type:args:)</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Error Messages</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
<p>Default implementation.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">error</span><span class="p">(</span><span class="n">_</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">args</span><span class="p">:</span> <span class="kt">Any</span><span class="o">...</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>message</em>
</code>
</td>
<td>
<div>
<p>The message being logged. Can include <code>%@</code> that will be replaced with <code>args</code></p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>type</em>
</code>
</td>
<td>
<div>
<p>The type of entity that called for logging.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>args</em>
</code>
</td>
<td>
<div>
<p>Any args that should be inserted into the message. May be left out.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,269 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocketDelegate Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/WebSocketDelegate" class="dashAnchor"></a>
<a title="WebSocketDelegate Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
WebSocketDelegate Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>WebSocketDelegate</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO17WebSocketDelegate19websocketDidConnectFT6socketCS_9WebSocket_T_"></a>
<a name="//apple_ref/swift/Method/websocketDidConnect(socket:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO17WebSocketDelegate19websocketDidConnectFT6socketCS_9WebSocket_T_">websocketDidConnect(socket:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO17WebSocketDelegate22websocketDidDisconnectFT6socketCS_9WebSocket5errorGSqCSo7NSError__T_"></a>
<a name="//apple_ref/swift/Method/websocketDidDisconnect(socket:error:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO17WebSocketDelegate22websocketDidDisconnectFT6socketCS_9WebSocket5errorGSqCSo7NSError__T_">websocketDidDisconnect(socket:error:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO17WebSocketDelegate26websocketDidReceiveMessageFT6socketCS_9WebSocket4textSS_T_"></a>
<a name="//apple_ref/swift/Method/websocketDidReceiveMessage(socket:text:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO17WebSocketDelegate26websocketDidReceiveMessageFT6socketCS_9WebSocket4textSS_T_">websocketDidReceiveMessage(socket:text:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO17WebSocketDelegate23websocketDidReceiveDataFT6socketCS_9WebSocket4dataV10Foundation4Data_T_"></a>
<a name="//apple_ref/swift/Method/websocketDidReceiveData(socket:data:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO17WebSocketDelegate23websocketDidReceiveDataFT6socketCS_9WebSocket4dataV10Foundation4Data_T_">websocketDidReceiveData(socket:data:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,212 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocketPongDelegate Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/WebSocketPongDelegate" class="dashAnchor"></a>
<a title="WebSocketPongDelegate Protocol Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
WebSocketPongDelegate Protocol Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>WebSocketPongDelegate</h1>
<p>Undocumented</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FP8SocketIO21WebSocketPongDelegate23websocketDidReceivePongFT6socketCS_9WebSocket4dataGSqV10Foundation4Data__T_"></a>
<a name="//apple_ref/swift/Method/websocketDidReceivePong(socket:data:)" class="dashAnchor"></a>
<a class="token" href="#/s:FP8SocketIO21WebSocketPongDelegate23websocketDidReceivePongFT6socketCS_9WebSocket4dataGSqV10Foundation4Data__T_">websocketDidReceivePong(socket:data:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

220
docs/Structs.html Normal file
View File

@ -0,0 +1,220 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Structs Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="Structs Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
Structs Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Structs</h1>
<p>The following structs are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:V8SocketIO27SocketIOClientConfiguration"></a>
<a name="//apple_ref/swift/Struct/SocketIOClientConfiguration" class="dashAnchor"></a>
<a class="token" href="#/s:V8SocketIO27SocketIOClientConfiguration">SocketIOClientConfiguration</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>An array-like type that holds <code><a href="Enums/SocketIOClientOption.html">SocketIOClientOption</a></code>s</p>
<a href="Structs/SocketIOClientConfiguration.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SocketIOClientConfiguration</span> <span class="p">:</span> <span class="kt">ExpressibleByArrayLiteral</span><span class="p">,</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">MutableCollection</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

View File

@ -0,0 +1,647 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketIOClientConfiguration Struct Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Struct/SocketIOClientConfiguration" class="dashAnchor"></a>
<a title="SocketIOClientConfiguration Struct Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">SocketIO Reference</a>
<img class="carat" src="../img/carat.png" />
SocketIOClientConfiguration Struct Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>SocketIOClientConfiguration</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SocketIOClientConfiguration</span> <span class="p">:</span> <span class="kt">ExpressibleByArrayLiteral</span><span class="p">,</span> <span class="kt">Collection</span><span class="p">,</span> <span class="kt">MutableCollection</span></code></pre>
</div>
</div>
<p>An array-like type that holds <code><a href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a></code>s</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<div class="task-name-container">
<a name="/Typealiases"></a>
<a name="//apple_ref/swift/Section/Typealiases" class="dashAnchor"></a>
<a href="#/Typealiases">
<h3 class="section-name">Typealiases</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:V8SocketIO27SocketIOClientConfiguration8Iterator"></a>
<a name="//apple_ref/swift/Alias/Iterator" class="dashAnchor"></a>
<a class="token" href="#/s:V8SocketIO27SocketIOClientConfiguration8Iterator">Iterator</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Iterator type.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Iterator</span> <span class="o">=</span> <span class="kt">Array</span><span class="o">&lt;</span><span class="kt"><a href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a></span><span class="o">&gt;.</span><span class="kt">Iterator</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:V8SocketIO27SocketIOClientConfiguration7Element"></a>
<a name="//apple_ref/swift/Alias/Element" class="dashAnchor"></a>
<a class="token" href="#/s:V8SocketIO27SocketIOClientConfiguration7Element">Element</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Type of element stored.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Element</span> <span class="o">=</span> <span class="kt"><a href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:V8SocketIO27SocketIOClientConfiguration11SubSequence"></a>
<a name="//apple_ref/swift/Alias/SubSequence" class="dashAnchor"></a>
<a class="token" href="#/s:V8SocketIO27SocketIOClientConfiguration11SubSequence">SubSequence</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>SubSequence type.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">SubSequence</span> <span class="o">=</span> <span class="kt">Array</span><span class="o">&lt;</span><span class="kt"><a href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a></span><span class="o">&gt;.</span><span class="kt">SubSequence</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:V8SocketIO27SocketIOClientConfiguration5Index"></a>
<a name="//apple_ref/swift/Alias/Index" class="dashAnchor"></a>
<a class="token" href="#/s:V8SocketIO27SocketIOClientConfiguration5Index">Index</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Index type.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Index</span> <span class="o">=</span> <span class="kt">Array</span><span class="o">&lt;</span><span class="kt"><a href="../Enums/SocketIOClientOption.html">SocketIOClientOption</a></span><span class="o">&gt;.</span><span class="kt">Index</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Properties"></a>
<a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
<a href="#/Properties">
<h3 class="section-name">Properties</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:vV8SocketIO27SocketIOClientConfiguration10startIndexSi"></a>
<a name="//apple_ref/swift/Property/startIndex" class="dashAnchor"></a>
<a class="token" href="#/s:vV8SocketIO27SocketIOClientConfiguration10startIndexSi">startIndex</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The start index of this collection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">startIndex</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration5Index">Index</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vV8SocketIO27SocketIOClientConfiguration8endIndexSi"></a>
<a name="//apple_ref/swift/Property/endIndex" class="dashAnchor"></a>
<a class="token" href="#/s:vV8SocketIO27SocketIOClientConfiguration8endIndexSi">endIndex</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The end index of this collection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">endIndex</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration5Index">Index</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vV8SocketIO27SocketIOClientConfiguration7isEmptySb"></a>
<a name="//apple_ref/swift/Property/isEmpty" class="dashAnchor"></a>
<a class="token" href="#/s:vV8SocketIO27SocketIOClientConfiguration7isEmptySb">isEmpty</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Whether this collection is empty.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isEmpty</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vV8SocketIO27SocketIOClientConfiguration5countSi"></a>
<a name="//apple_ref/swift/Property/count" class="dashAnchor"></a>
<a class="token" href="#/s:vV8SocketIO27SocketIOClientConfiguration5countSi">count</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The number of elements stored in this collection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">count</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration5Index">Index</a></span><span class="o">.</span><span class="kt">Stride</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vV8SocketIO27SocketIOClientConfiguration5firstGSqOS_20SocketIOClientOption_"></a>
<a name="//apple_ref/swift/Property/first" class="dashAnchor"></a>
<a class="token" href="#/s:vV8SocketIO27SocketIOClientConfiguration5firstGSqOS_20SocketIOClientOption_">first</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The first element in this collection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">first</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration7Element">Element</a></span><span class="p">?</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Initializers"></a>
<a name="//apple_ref/swift/Section/Initializers" class="dashAnchor"></a>
<a href="#/Initializers">
<h3 class="section-name">Initializers</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FV8SocketIO27SocketIOClientConfigurationcFt12arrayLiteralGSaOS_20SocketIOClientOption__S0_"></a>
<a name="//apple_ref/swift/Method/init(arrayLiteral:)" class="dashAnchor"></a>
<a class="token" href="#/s:FV8SocketIO27SocketIOClientConfigurationcFt12arrayLiteralGSaOS_20SocketIOClientOption__S0_">init(arrayLiteral:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Creates a new <code>SocketIOClientConfiguration</code> from an array literal.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">arrayLiteral</span> <span class="nv">elements</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration7Element">Element</a></span><span class="o">...</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>arrayLiteral</em>
</code>
</td>
<td>
<div>
<p>The elements.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/Methods"></a>
<a name="//apple_ref/swift/Section/Methods" class="dashAnchor"></a>
<a href="#/Methods">
<h3 class="section-name">Methods</h3>
</a>
</div>
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:FV8SocketIO27SocketIOClientConfiguration12makeIteratorFT_GVs16IndexingIteratorGSaOS_20SocketIOClientOption__"></a>
<a name="//apple_ref/swift/Method/makeIterator()" class="dashAnchor"></a>
<a class="token" href="#/s:FV8SocketIO27SocketIOClientConfiguration12makeIteratorFT_GVs16IndexingIteratorGSaOS_20SocketIOClientOption__">makeIterator()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Creates an iterator for this collection.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">makeIterator</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration8Iterator">Iterator</a></span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>An iterator over this collection.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FV8SocketIO27SocketIOClientConfiguration5indexFT5afterSi_Si"></a>
<a name="//apple_ref/swift/Method/index(after:)" class="dashAnchor"></a>
<a class="token" href="#/s:FV8SocketIO27SocketIOClientConfiguration5indexFT5afterSi_Si">index(after:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">index</span><span class="p">(</span><span class="n">after</span> <span class="nv">i</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration5Index">Index</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration5Index">Index</a></span></code></pre>
</div>
</div>
<div>
<h4>Return Value</h4>
<p>The index after index.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FV8SocketIO27SocketIOClientConfiguration6insertFTOS_20SocketIOClientOption9replacingSb_T_"></a>
<a name="//apple_ref/swift/Method/insert(_:replacing:)" class="dashAnchor"></a>
<a class="token" href="#/s:FV8SocketIO27SocketIOClientConfiguration6insertFTOS_20SocketIOClientOption9replacingSb_T_">insert(_:replacing:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Special method that inserts <code>element</code> into the collection, replacing any other instances of <code>element</code>.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">insert</span><span class="p">(</span><span class="n">_</span> <span class="nv">element</span><span class="p">:</span> <span class="kt"><a href="../Structs/SocketIOClientConfiguration.html#/s:V8SocketIO27SocketIOClientConfiguration7Element">Element</a></span><span class="p">,</span> <span class="n">replacing</span> <span class="nv">replace</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>element</em>
</code>
</td>
<td>
<div>
<p>The element to insert.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>replacing</em>
</code>
</td>
<td>
<div>
<p>Whether to replace any occurrences of element to the new item. Default is <code>true</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

246
docs/Typealiases.html Normal file
View File

@ -0,0 +1,246 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Typealiases Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="Typealiases Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
Typealiases Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Typealiases</h1>
<p>The following typealiases are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:8SocketIO14NormalCallback"></a>
<a name="//apple_ref/swift/Alias/NormalCallback" class="dashAnchor"></a>
<a class="token" href="#/s:8SocketIO14NormalCallback">NormalCallback</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A typealias for a normal callback.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">NormalCallback</span> <span class="o">=</span> <span class="p">([</span><span class="kt">Any</span><span class="p">],</span> <span class="kt"><a href="Classes/SocketAckEmitter.html">SocketAckEmitter</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:8SocketIO11AckCallback"></a>
<a name="//apple_ref/swift/Alias/AckCallback" class="dashAnchor"></a>
<a class="token" href="#/s:8SocketIO11AckCallback">AckCallback</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A typealias for an ack callback.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">AckCallback</span> <span class="o">=</span> <span class="p">([</span><span class="kt">Any</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt">Void</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

1
docs/badge.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="128" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h93v20H0z"/><path fill="#a4a61d" d="M93 0h35v20H93z"/><path fill="url(#b)" d="M0 0h128v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="46.5" y="15" fill="#010101" fill-opacity=".3">documentation</text><text x="46.5" y="14">documentation</text><text x="109.5" y="15" fill="#010101" fill-opacity=".3">84%</text><text x="109.5" y="14">84%</text></g></svg>

After

Width:  |  Height:  |  Size: 808 B

200
docs/css/highlight.css Normal file
View File

@ -0,0 +1,200 @@
/* Credit to https://gist.github.com/wataru420/2048287 */
.highlight {
/* Comment */
/* Error */
/* Keyword */
/* Operator */
/* Comment.Multiline */
/* Comment.Preproc */
/* Comment.Single */
/* Comment.Special */
/* Generic.Deleted */
/* Generic.Deleted.Specific */
/* Generic.Emph */
/* Generic.Error */
/* Generic.Heading */
/* Generic.Inserted */
/* Generic.Inserted.Specific */
/* Generic.Output */
/* Generic.Prompt */
/* Generic.Strong */
/* Generic.Subheading */
/* Generic.Traceback */
/* Keyword.Constant */
/* Keyword.Declaration */
/* Keyword.Pseudo */
/* Keyword.Reserved */
/* Keyword.Type */
/* Literal.Number */
/* Literal.String */
/* Name.Attribute */
/* Name.Builtin */
/* Name.Class */
/* Name.Constant */
/* Name.Entity */
/* Name.Exception */
/* Name.Function */
/* Name.Namespace */
/* Name.Tag */
/* Name.Variable */
/* Operator.Word */
/* Text.Whitespace */
/* Literal.Number.Float */
/* Literal.Number.Hex */
/* Literal.Number.Integer */
/* Literal.Number.Oct */
/* Literal.String.Backtick */
/* Literal.String.Char */
/* Literal.String.Doc */
/* Literal.String.Double */
/* Literal.String.Escape */
/* Literal.String.Heredoc */
/* Literal.String.Interpol */
/* Literal.String.Other */
/* Literal.String.Regex */
/* Literal.String.Single */
/* Literal.String.Symbol */
/* Name.Builtin.Pseudo */
/* Name.Variable.Class */
/* Name.Variable.Global */
/* Name.Variable.Instance */
/* Literal.Number.Integer.Long */ }
.highlight .c {
color: #999988;
font-style: italic; }
.highlight .err {
color: #a61717;
background-color: #e3d2d2; }
.highlight .k {
color: #000000;
font-weight: bold; }
.highlight .o {
color: #000000;
font-weight: bold; }
.highlight .cm {
color: #999988;
font-style: italic; }
.highlight .cp {
color: #999999;
font-weight: bold; }
.highlight .c1 {
color: #999988;
font-style: italic; }
.highlight .cs {
color: #999999;
font-weight: bold;
font-style: italic; }
.highlight .gd {
color: #000000;
background-color: #ffdddd; }
.highlight .gd .x {
color: #000000;
background-color: #ffaaaa; }
.highlight .ge {
color: #000000;
font-style: italic; }
.highlight .gr {
color: #aa0000; }
.highlight .gh {
color: #999999; }
.highlight .gi {
color: #000000;
background-color: #ddffdd; }
.highlight .gi .x {
color: #000000;
background-color: #aaffaa; }
.highlight .go {
color: #888888; }
.highlight .gp {
color: #555555; }
.highlight .gs {
font-weight: bold; }
.highlight .gu {
color: #aaaaaa; }
.highlight .gt {
color: #aa0000; }
.highlight .kc {
color: #000000;
font-weight: bold; }
.highlight .kd {
color: #000000;
font-weight: bold; }
.highlight .kp {
color: #000000;
font-weight: bold; }
.highlight .kr {
color: #000000;
font-weight: bold; }
.highlight .kt {
color: #445588; }
.highlight .m {
color: #009999; }
.highlight .s {
color: #d14; }
.highlight .na {
color: #008080; }
.highlight .nb {
color: #0086B3; }
.highlight .nc {
color: #445588;
font-weight: bold; }
.highlight .no {
color: #008080; }
.highlight .ni {
color: #800080; }
.highlight .ne {
color: #990000;
font-weight: bold; }
.highlight .nf {
color: #990000; }
.highlight .nn {
color: #555555; }
.highlight .nt {
color: #000080; }
.highlight .nv {
color: #008080; }
.highlight .ow {
color: #000000;
font-weight: bold; }
.highlight .w {
color: #bbbbbb; }
.highlight .mf {
color: #009999; }
.highlight .mh {
color: #009999; }
.highlight .mi {
color: #009999; }
.highlight .mo {
color: #009999; }
.highlight .sb {
color: #d14; }
.highlight .sc {
color: #d14; }
.highlight .sd {
color: #d14; }
.highlight .s2 {
color: #d14; }
.highlight .se {
color: #d14; }
.highlight .sh {
color: #d14; }
.highlight .si {
color: #d14; }
.highlight .sx {
color: #d14; }
.highlight .sr {
color: #009926; }
.highlight .s1 {
color: #d14; }
.highlight .ss {
color: #990073; }
.highlight .bp {
color: #999999; }
.highlight .vc {
color: #008080; }
.highlight .vg {
color: #008080; }
.highlight .vi {
color: #008080; }
.highlight .il {
color: #009999; }

368
docs/css/jazzy.css Normal file
View File

@ -0,0 +1,368 @@
*, *:before, *:after {
box-sizing: inherit; }
body {
margin: 0;
background: #fff;
color: #333;
font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
letter-spacing: .2px;
-webkit-font-smoothing: antialiased;
box-sizing: border-box; }
h1 {
font-size: 2rem;
font-weight: 700;
margin: 1.275em 0 0.6em; }
h2 {
font-size: 1.75rem;
font-weight: 700;
margin: 1.275em 0 0.3em; }
h3 {
font-size: 1.5rem;
font-weight: 700;
margin: 1em 0 0.3em; }
h4 {
font-size: 1.25rem;
font-weight: 700;
margin: 1.275em 0 0.85em; }
h5 {
font-size: 1rem;
font-weight: 700;
margin: 1.275em 0 0.85em; }
h6 {
font-size: 1rem;
font-weight: 700;
margin: 1.275em 0 0.85em;
color: #777; }
p {
margin: 0 0 1em; }
ul, ol {
padding: 0 0 0 2em;
margin: 0 0 0.85em; }
blockquote {
margin: 0 0 0.85em;
padding: 0 15px;
color: #858585;
border-left: 4px solid #e5e5e5; }
img {
max-width: 100%; }
a {
color: #4183c4;
text-decoration: none; }
a:hover, a:focus {
outline: 0;
text-decoration: underline; }
table {
background: #fff;
width: 100%;
border-collapse: collapse;
border-spacing: 0;
overflow: auto;
margin: 0 0 0.85em; }
tr:nth-child(2n) {
background-color: #fbfbfb; }
th, td {
padding: 6px 13px;
border: 1px solid #ddd; }
pre {
margin: 0 0 1.275em;
padding: .85em 1em;
overflow: auto;
background: #f7f7f7;
font-size: .85em;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; }
p > code, li > code {
background: #f7f7f7;
padding: .2em; }
p > code:before, p > code:after, li > code:before, li > code:after {
letter-spacing: -.2em;
content: "\00a0"; }
pre code {
padding: 0;
white-space: pre; }
.content-wrapper {
display: flex;
flex-direction: column; }
@media (min-width: 768px) {
.content-wrapper {
flex-direction: row; } }
.header {
display: flex;
padding: 8px;
font-size: 0.875em;
background: #444;
color: #999; }
.header-col {
margin: 0;
padding: 0 8px; }
.header-col--primary {
flex: 1; }
.header-link {
color: #fff; }
.header-icon {
padding-right: 6px;
vertical-align: -4px;
height: 16px; }
.breadcrumbs {
font-size: 0.875em;
padding: 8px 16px;
margin: 0;
background: #fbfbfb;
border-bottom: 1px solid #ddd; }
.carat {
height: 10px;
margin: 0 5px; }
.navigation {
order: 2; }
@media (min-width: 768px) {
.navigation {
order: 1;
width: 25%;
max-width: 300px;
padding-bottom: 64px;
overflow: hidden;
word-wrap: normal;
background: #fbfbfb;
border-right: 1px solid #ddd; } }
.nav-groups {
list-style-type: none;
padding-left: 0; }
.nav-group-name {
border-bottom: 1px solid #ddd;
padding: 8px 0 8px 16px; }
.nav-group-name-link {
color: #333; }
.nav-group-tasks {
margin: 8px 0;
padding: 0 0 0 8px; }
.nav-group-task {
font-size: 1em;
list-style-type: none;
white-space: nowrap; }
.nav-group-task-link {
color: #808080; }
.main-content {
order: 1; }
@media (min-width: 768px) {
.main-content {
order: 2;
flex: 1;
padding-bottom: 60px; } }
.section {
padding: 0 32px;
border-bottom: 1px solid #ddd; }
.section-content {
max-width: 834px;
margin: 0 auto;
padding: 16px 0; }
.section-name {
color: #666;
display: block; }
.declaration .highlight {
overflow-x: initial;
padding: 8px 0;
margin: 0;
background-color: transparent;
border: none; }
.task-group-section {
border-top: 1px solid #ddd; }
.task-group {
padding-top: 0px; }
.task-name-container a[name]:before {
content: "";
display: block; }
.item-container {
padding: 0; }
.item {
padding-top: 8px;
width: 100%;
list-style-type: none; }
.item a[name]:before {
content: "";
display: block; }
.item .token {
padding-left: 3px;
margin-left: 0px;
font-size: 1rem; }
.item .declaration-note {
font-size: .85em;
color: #808080;
font-style: italic; }
.pointer-container {
border-bottom: 1px solid #ddd;
left: -23px;
padding-bottom: 13px;
position: relative;
width: 110%; }
.pointer {
left: 21px;
top: 7px;
display: block;
position: absolute;
width: 12px;
height: 12px;
border-left: 1px solid #ddd;
border-top: 1px solid #ddd;
background: #fff;
transform: rotate(45deg); }
.height-container {
display: none;
position: relative;
width: 100%;
overflow: hidden; }
.height-container .section {
background: #fff;
border: 1px solid #ddd;
border-top-width: 0;
padding-top: 10px;
padding-bottom: 5px;
padding: 8px 16px; }
.aside, .language {
padding: 6px 12px;
margin: 12px 0;
border-left: 5px solid #dddddd;
overflow-y: hidden; }
.aside .aside-title, .language .aside-title {
font-size: 9px;
letter-spacing: 2px;
text-transform: uppercase;
padding-bottom: 0;
margin: 0;
color: #aaa;
-webkit-user-select: none; }
.aside p:last-child, .language p:last-child {
margin-bottom: 0; }
.language {
border-left: 5px solid #cde9f4; }
.language .aside-title {
color: #4183c4; }
.aside-warning {
border-left: 5px solid #ff6666; }
.aside-warning .aside-title {
color: #ff0000; }
.graybox {
border-collapse: collapse;
width: 100%; }
.graybox p {
margin: 0;
word-break: break-word;
min-width: 50px; }
.graybox td {
border: 1px solid #ddd;
padding: 5px 25px 5px 10px;
vertical-align: middle; }
.graybox tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px; }
.slightly-smaller {
font-size: 0.9em; }
.footer {
padding: 8px 16px;
background: #444;
color: #ddd;
font-size: 0.8em; }
.footer p {
margin: 8px 0; }
.footer a {
color: #fff; }
html.dash .header, html.dash .breadcrumbs, html.dash .navigation {
display: none; }
html.dash .height-container {
display: block; }
form[role=search] input {
font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 24px;
padding: 0 10px;
margin: 0;
border: none;
border-radius: 1em; }
.loading form[role=search] input {
background: white url(../img/spinner.gif) center right 4px no-repeat; }
form[role=search] .tt-menu {
margin: 0;
min-width: 300px;
background: #fbfbfb;
color: #333;
border: 1px solid #ddd; }
form[role=search] .tt-highlight {
font-weight: bold; }
form[role=search] .tt-suggestion {
font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 0 8px; }
form[role=search] .tt-suggestion span {
display: table-cell;
white-space: nowrap; }
form[role=search] .tt-suggestion .doc-parent-name {
width: 100%;
text-align: right;
font-weight: normal;
font-size: 0.9em;
padding-left: 16px; }
form[role=search] .tt-suggestion:hover,
form[role=search] .tt-suggestion.tt-cursor {
cursor: pointer;
background-color: #4183c4;
color: #fff; }
form[role=search] .tt-suggestion:hover .doc-parent-name,
form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
color: #fff; }

BIN
docs/img/carat.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

BIN
docs/img/dash.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
docs/img/gh.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
docs/img/spinner.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

376
docs/index.html Normal file
View File

@ -0,0 +1,376 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>SocketIO Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="SocketIO Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SocketIO Docs
</a>
(84% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SocketIO Reference</a>
<img class="carat" src="img/carat.png" />
SocketIO Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/OnAckCallback.html">OnAckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLCert.html">SSLCert</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SSLSecurity.html">SSLSecurity</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAckEmitter.html">SocketAckEmitter</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketAnyEvent.html">SocketAnyEvent</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketClientManager.html">SocketClientManager</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketEngine.html">SocketEngine</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SocketIOClient.html">SocketIOClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket.html">WebSocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/WebSocket/CloseCode.html"> CloseCode</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO31WebsocketDidConnectNotificationSS">WebsocketDidConnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDidDisconnectNotificationSS">WebsocketDidDisconnectNotification</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Global Variables.html#/s:v8SocketIO34WebsocketDisconnectionErrorKeyNameSS">WebsocketDisconnectionErrorKeyName</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketAckStatus.html">SocketAckStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketEnginePacketType.html">SocketEnginePacketType</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientOption.html">SocketIOClientOption</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SocketIOClientStatus.html">SocketIOClientStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SSLTrustValidator.html">SSLTrustValidator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols.html#/s:P8SocketIO10SocketData">SocketData</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineClient.html">SocketEngineClient</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEnginePollable.html">SocketEnginePollable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineSpec.html">SocketEngineSpec</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketEngineWebsocket.html">SocketEngineWebsocket</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SocketLogger.html">SocketLogger</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketDelegate.html">WebSocketDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/WebSocketPongDelegate.html">WebSocketPongDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SocketIOClientConfiguration.html">SocketIOClientConfiguration</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO11AckCallback">AckCallback</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallback">NormalCallback</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<p><a href="https://travis-ci.org/socketio/socket.io-client-swift"><img src="https://travis-ci.org/socketio/socket.io-client-swift.svg?branch=master" alt="Build Status"></a></p>
<h1 id='socket-io-client-swift' class='heading'>Socket.IO-Client-Swift</h1>
<p>Socket.IO-client for iOS/OS X.</p>
<h2 id='example' class='heading'>Example</h2>
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">SocketIO</span>
<span class="k">let</span> <span class="nv">socket</span> <span class="o">=</span> <span class="kt">SocketIOClient</span><span class="p">(</span><span class="nv">socketURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="s">"http://localhost:8080"</span><span class="p">)</span><span class="o">!</span><span class="p">,</span> <span class="nv">config</span><span class="p">:</span> <span class="p">[</span><span class="o">.</span><span class="nf">log</span><span class="p">(</span><span class="kc">true</span><span class="p">),</span> <span class="o">.</span><span class="nf">forcePolling</span><span class="p">(</span><span class="kc">true</span><span class="p">)])</span>
<span class="n">socket</span><span class="o">.</span><span class="nf">on</span><span class="p">(</span><span class="s">"connect"</span><span class="p">)</span> <span class="p">{</span><span class="n">data</span><span class="p">,</span> <span class="n">ack</span> <span class="k">in</span>
<span class="nf">print</span><span class="p">(</span><span class="s">"socket connected"</span><span class="p">)</span>
<span class="p">}</span>
<span class="n">socket</span><span class="o">.</span><span class="nf">on</span><span class="p">(</span><span class="s">"currentAmount"</span><span class="p">)</span> <span class="p">{</span><span class="n">data</span><span class="p">,</span> <span class="n">ack</span> <span class="k">in</span>
<span class="k">if</span> <span class="k">let</span> <span class="nv">cur</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">as?</span> <span class="kt">Double</span> <span class="p">{</span>
<span class="n">socket</span><span class="o">.</span><span class="nf">emitWithAck</span><span class="p">(</span><span class="s">"canUpdate"</span><span class="p">,</span> <span class="n">cur</span><span class="p">)</span><span class="o">.</span><span class="nf">timingOut</span><span class="p">(</span><span class="nv">after</span><span class="p">:</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span><span class="n">data</span> <span class="k">in</span>
<span class="n">socket</span><span class="o">.</span><span class="nf">emit</span><span class="p">(</span><span class="s">"update"</span><span class="p">,</span> <span class="p">[</span><span class="s">"amount"</span><span class="p">:</span> <span class="n">cur</span> <span class="o">+</span> <span class="mf">2.50</span><span class="p">])</span>
<span class="p">}</span>
<span class="n">ack</span><span class="o">.</span><span class="nf">with</span><span class="p">(</span><span class="s">"Got your currentAmount"</span><span class="p">,</span> <span class="s">"dude"</span><span class="p">)</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="n">socket</span><span class="o">.</span><span class="nf">connect</span><span class="p">()</span>
</code></pre>
<h2 id='objective-c-example' class='heading'>Objective-C Example</h2>
<pre class="highlight plaintext"><code>@import SocketIO;
NSURL* url = [[NSURL alloc] initWithString:@"http://localhost:8080"];
SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:url config:@{@"log": @YES, @"forcePolling": @YES}];
[socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
NSLog(@"socket connected");
}];
[socket on:@"currentAmount" callback:^(NSArray* data, SocketAckEmitter* ack) {
double cur = [[data objectAtIndex:0] floatValue];
[[socket emitWithAck:@"canUpdate" with:@[@(cur)]] timingOutAfter:0 callback:^(NSArray* data) {
[socket emit:@"update" withItems:@[@{@"amount": @(cur + 2.50)}]];
}];
[ack with:@[@"Got your currentAmount, ", @"dude"]];
}];
[socket connect];
</code></pre>
<h2 id='features' class='heading'>Features</h2>
<ul>
<li>Supports socket.io 1.0+</li>
<li>Supports binary</li>
<li>Supports Polling and WebSockets</li>
<li>Supports TLS/SSL</li>
<li>Can be used from Objective-C</li>
</ul>
<h2 id='installation' class='heading'>Installation</h2>
<p>Requires Swift 3/Xcode 8.x</p>
<p>If you need swift 2.3 use the swift2.3 tag (Pre-Swift 3 support is no longer maintained)</p>
<p>If you need swift 2.2 use 7.x (Pre-Swift 3 support is no longer maintained)</p>
<p>If you need Swift 2.1 use v5.5.0 (Pre-Swift 2.2 support is no longer maintained)</p>
<p>If you need Swift 1.2 use v2.4.5 (Pre-Swift 2 support is no longer maintained)</p>
<p>If you need Swift 1.1 use v1.5.2. (Pre-Swift 1.2 support is no longer maintained)</p>
<h3 id='manually-ios-7' class='heading'>Manually (iOS 7+)</h3>
<ol>
<li>Copy the Source folder into your Xcode project. (Make sure you add the files to your target(s))</li>
<li>If you plan on using this from Objective-C, read <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html">this</a> on exposing Swift code to Objective-C.</li>
</ol>
<h3 id='swift-package-manager' class='heading'>Swift Package Manager</h3>
<p>Add the project as a dependency to your Package.swift:</p>
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">PackageDescription</span>
<span class="k">let</span> <span class="nv">package</span> <span class="o">=</span> <span class="kt">Package</span><span class="p">(</span>
<span class="nv">name</span><span class="p">:</span> <span class="s">"YourSocketIOProject"</span><span class="p">,</span>
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span>
<span class="o">.</span><span class="kt">Package</span><span class="p">(</span><span class="nv">url</span><span class="p">:</span> <span class="s">"https://github.com/socketio/socket.io-client-swift"</span><span class="p">,</span> <span class="nv">majorVersion</span><span class="p">:</span> <span class="mi">8</span><span class="p">)</span>
<span class="p">]</span>
<span class="p">)</span>
</code></pre>
<p>Then import <code>import SocketIO</code>.</p>
<h3 id='carthage' class='heading'>Carthage</h3>
<p>Add this line to your <code>Cartfile</code>:</p>
<pre class="highlight plaintext"><code>github "socketio/socket.io-client-swift" ~&gt; 8.3.3 # Or latest version
</code></pre>
<p>Run <code>carthage update --platform ios,macosx</code>.</p>
<h3 id='cocoapods-1-0-0-or-later' class='heading'>CocoaPods 1.0.0 or later</h3>
<p>Create <code>Podfile</code> and add <code>pod &#39;Socket.IO-Client-Swift&#39;</code>:</p>
<pre class="highlight ruby"><code><span class="n">use_frameworks!</span>
<span class="n">target</span> <span class="s1">'YourApp'</span> <span class="k">do</span>
<span class="n">pod</span> <span class="s1">'Socket.IO-Client-Swift'</span><span class="p">,</span> <span class="s1">'~&gt; 8.3.3'</span> <span class="c1"># Or latest version</span>
<span class="k">end</span>
</code></pre>
<p>Install pods:</p>
<pre class="highlight plaintext"><code>$ pod install
</code></pre>
<p>Import the module:</p>
<p>Swift:</p>
<pre class="highlight swift"><code><span class="kd">import</span> <span class="kt">SocketIO</span>
</code></pre>
<p>Objective-C:</p>
<pre class="highlight plaintext"><code>@import SocketIO;
</code></pre>
<h3 id='cocoaseeds' class='heading'>CocoaSeeds</h3>
<p>Add this line to your <code>Seedfile</code>:</p>
<pre class="highlight plaintext"><code>github "socketio/socket.io-client-swift", "v8.3.3", :files =&gt; "Source/*.swift" # Or latest version
</code></pre>
<p>Run <code>seed install</code>.</p>
<h1 id='api' class='heading'>API</h1>
<h2 id='constructors' class='heading'>Constructors</h2>
<p><code>init(var socketURL: NSURL, config: SocketIOClientConfiguration = [])</code> - Creates a new SocketIOClient. If your socket.io server is secure, you need to specify <code>https</code> in your socketURL.</p>
<p><code>convenience init(socketURL: NSURL, options: NSDictionary?)</code> - Same as above, but meant for Objective-C. See Options on how convert between SocketIOClientOptions and dictionary keys.</p>
<h3 id='options' class='heading'>Options</h3>
<p>All options are a case of SocketIOClientOption. To get the Objective-C Option, convert the name to lowerCamelCase.</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">connectParams</span><span class="p">([</span><span class="kt">String</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">])</span> <span class="c1">// Dictionary whose contents will be passed with the connection.</span>
<span class="k">case</span> <span class="nf">cookies</span><span class="p">([</span><span class="kt">NSHTTPCookie</span><span class="p">])</span> <span class="c1">// An array of NSHTTPCookies. Passed during the handshake. Default is nil.</span>
<span class="k">case</span> <span class="nf">doubleEncodeUTF8</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// Whether or not to double encode utf8. If using the node based server this should be true. Default is true.</span>
<span class="k">case</span> <span class="nf">extraHeaders</span><span class="p">([</span><span class="kt">String</span><span class="p">:</span> <span class="kt">String</span><span class="p">])</span> <span class="c1">// Adds custom headers to the initial request. Default is nil.</span>
<span class="k">case</span> <span class="nf">forcePolling</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// `true` forces the client to use xhr-polling. Default is `false`</span>
<span class="k">case</span> <span class="nf">forceNew</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// Will a create a new engine for each connect. Useful if you find a bug in the engine related to reconnects</span>
<span class="k">case</span> <span class="nf">forceWebsockets</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// `true` forces the client to use WebSockets. Default is `false`</span>
<span class="k">case</span> <span class="nf">handleQueue</span><span class="p">(</span><span class="n">dispatch_queue_t</span><span class="p">)</span> <span class="c1">// The dispatch queue that handlers are run on. Default is the main queue.</span>
<span class="k">case</span> <span class="nf">log</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// If `true` socket will log debug messages. Default is false.</span>
<span class="k">case</span> <span class="nf">logger</span><span class="p">(</span><span class="kt">SocketLogger</span><span class="p">)</span> <span class="c1">// Custom logger that conforms to SocketLogger. Will use the default logging otherwise.</span>
<span class="k">case</span> <span class="nf">nsp</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span> <span class="c1">// The namespace to connect to. Must begin with /. Default is `/`</span>
<span class="k">case</span> <span class="nf">path</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span> <span class="c1">// If the server uses a custom path. ex: `"/swift/"`. Default is `""`</span>
<span class="k">case</span> <span class="nf">reconnects</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// Whether to reconnect on server lose. Default is `true`</span>
<span class="k">case</span> <span class="nf">reconnectAttempts</span><span class="p">(</span><span class="kt">Int</span><span class="p">)</span> <span class="c1">// How many times to reconnect. Default is `-1` (infinite tries)</span>
<span class="k">case</span> <span class="nf">reconnectWait</span><span class="p">(</span><span class="kt">Int</span><span class="p">)</span> <span class="c1">// Amount of time to wait between reconnects. Default is `10`</span>
<span class="k">case</span> <span class="nf">sessionDelegate</span><span class="p">(</span><span class="kt">NSURLSessionDelegate</span><span class="p">)</span> <span class="c1">// Sets an NSURLSessionDelegate for the underlying engine. Useful if you need to handle self-signed certs. Default is nil.</span>
<span class="k">case</span> <span class="nf">secure</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// If the connection should use TLS. Default is false.</span>
<span class="k">case</span> <span class="nf">security</span><span class="p">(</span><span class="kt">SSLSecurity</span><span class="p">)</span> <span class="c1">// Allows you to set which certs are valid. Useful for SSL pinning.</span>
<span class="k">case</span> <span class="nf">selfSigned</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// Sets WebSocket.selfSignedSSL. Use this if you're using self-signed certs.</span>
<span class="k">case</span> <span class="nf">voipEnabled</span><span class="p">(</span><span class="kt">Bool</span><span class="p">)</span> <span class="c1">// Only use this option if you're using the client with VoIP services. Changes the way the WebSocket is created. Default is false</span>
</code></pre>
<h3 id='methods' class='heading'>Methods</h3>
<ol>
<li><code>on(_ event: String, callback: NormalCallback) -&gt; NSUUID</code> - Adds a handler for an event. Items are passed by an array. <code>ack</code> can be used to send an ack when one is requested. See example. Returns a unique id for the handler.</li>
<li><code>once(_ event: String, callback: NormalCallback) -&gt; NSUUID</code> - Adds a handler that will only be executed once. Returns a unique id for the handler.</li>
<li><code>onAny(callback:((event: String, items: AnyObject?)) -&gt; Void)</code> - Adds a handler for all events. It will be called on any received event.</li>
<li><code>emit(_ event: String, _ items: AnyObject...)</code> - Sends a message. Can send multiple items.</li>
<li><code>emit(_ event: String, withItems items: [AnyObject])</code> - <code>emit</code> for Objective-C</li>
<li><code>emitWithAck(_ event: String, _ items: AnyObject...) -&gt; OnAckCallback</code> - Sends a message that requests an acknowledgement from the server. Returns an object which you can use to add a handler. See example. Note: The message is not sent until you call timingOut(after:) on the returned object.</li>
<li><code>emitWithAck(_ event: String, withItems items: [AnyObject]) -&gt; OnAckCallback</code> - <code>emitWithAck</code> for Objective-C. Note: The message is not sent until you call timingOutAfter on the returned object.</li>
<li><code>connect()</code> - Establishes a connection to the server. A <q>connect</q> event is fired upon successful connection.</li>
<li><code>connect(timeoutAfter timeoutAfter: Int, withTimeoutHandler handler: (() -&gt; Void)?)</code> - Connect to the server. If it isn&rsquo;t connected after timeoutAfter seconds, the handler is called.</li>
<li><code>disconnect()</code> - Closes the socket. Reopening a disconnected socket is not fully tested.</li>
<li><code>reconnect()</code> - Causes the client to reconnect to the server.</li>
<li><code>joinNamespace(_ namespace: String)</code> - Causes the client to join namespace. Shouldn&rsquo;t need to be called unless you change namespaces manually.</li>
<li><code>leaveNamespace()</code> - Causes the client to leave the nsp and go back to /</li>
<li><code>off(_ event: String)</code> - Removes all event handlers for event.</li>
<li><code>off(id id: NSUUID)</code> - Removes the event that corresponds to id.</li>
<li><code>removeAllHandlers()</code> - Removes all handlers.</li>
</ol>
<h3 id='client-events' class='heading'>Client Events</h3>
<ol>
<li><code>connect</code> - Emitted when on a successful connection.</li>
<li><code>disconnect</code> - Emitted when the connection is closed.</li>
<li><code>error</code> - Emitted on an error.</li>
<li><code>reconnect</code> - Emitted when the connection is starting to reconnect.</li>
<li><code>reconnectAttempt</code> - Emitted when attempting to reconnect.</li>
</ol>
<h2 id='detailed-example' class='heading'>Detailed Example</h2>
<p>A more detailed example can be found <a href="https://github.com/nuclearace/socket.io-client-swift-example">here</a></p>
<p>An example using the Swift Package Manager can be found <a href="https://github.com/nuclearace/socket.io-client-swift-spm-example">here</a></p>
<h2 id='license' class='heading'>License</h2>
<p>MIT</p>
</div>
</section>
</article>
</div>
<section class="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2017-05-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>

43
docs/js/jazzy.js Executable file
View File

@ -0,0 +1,43 @@
window.jazzy = {'docset': false}
if (typeof window.dash != 'undefined') {
document.documentElement.className += ' dash'
window.jazzy.docset = true
}
if (navigator.userAgent.match(/xcode/i)) {
document.documentElement.className += ' xcode'
window.jazzy.docset = true
}
// On doc load, toggle the URL hash discussion if present
$(document).ready(function() {
if (!window.jazzy.docset) {
var linkToHash = $('a[href="' + window.location.hash +'"]');
linkToHash.trigger("click");
}
});
// On token click, toggle its discussion and animate token.marginLeft
$(".token").click(function(event) {
if (window.jazzy.docset) {
return;
}
var link = $(this);
var animationDuration = 300;
$content = link.parent().parent().next();
$content.slideToggle(animationDuration);
// Keeps the document from jumping to the hash.
var href = $(this).attr('href');
if (history.pushState) {
history.pushState({}, '', href);
} else {
location.hash = href;
}
event.preventDefault();
});
// Dumb down quotes within code blocks that delimit strings instead of quotations
// https://github.com/realm/jazzy/issues/714
$("code q").replaceWith(function () {
return ["\"", $(this).contents(), "\""];
});

62
docs/js/jazzy.search.js Normal file
View File

@ -0,0 +1,62 @@
$(function(){
var searchIndex = lunr(function() {
this.ref('url');
this.field('name');
});
var $typeahead = $('[data-typeahead]');
var $form = $typeahead.parents('form');
var searchURL = $form.attr('action');
function displayTemplate(result) {
return result.name;
}
function suggestionTemplate(result) {
var t = '<div class="list-group-item clearfix">';
t += '<span class="doc-name">' + result.name + '</span>';
if (result.parent_name) {
t += '<span class="doc-parent-name label">' + result.parent_name + '</span>';
}
t += '</div>';
return t;
}
$typeahead.one('focus', function() {
$form.addClass('loading');
$.getJSON(searchURL).then(function(searchData) {
$.each(searchData, function (url, doc) {
searchIndex.add({url: url, name: doc.name});
});
$typeahead.typeahead(
{
highlight: true,
minLength: 3
},
{
limit: 10,
display: displayTemplate,
templates: { suggestion: suggestionTemplate },
source: function(query, sync) {
var results = searchIndex.search(query).map(function(result) {
var doc = searchData[result.ref];
doc.url = result.ref;
return doc;
});
sync(results);
}
}
);
$form.removeClass('loading');
$typeahead.trigger('focus');
});
});
var baseURL = searchURL.slice(0, -"search.json".length);
$typeahead.on('typeahead:select', function(e, result) {
window.location = baseURL + result.url;
});
});

4
docs/js/jquery.min.js vendored Executable file

File diff suppressed because one or more lines are too long

6
docs/js/lunr.min.js vendored Executable file

File diff suppressed because one or more lines are too long

1538
docs/js/typeahead.jquery.js Normal file

File diff suppressed because it is too large Load Diff

1
docs/search.json Normal file

File diff suppressed because one or more lines are too long