Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7ef126d97 | ||
|
|
e4f63e8f15 | ||
|
|
ec86a19fc6 | ||
|
|
e0cbe59a10 | ||
|
|
8f94c038d8 | ||
|
|
a4b334b6f2 | ||
|
|
9708019adc | ||
|
|
5a6a4f02d9 | ||
|
|
75057023cb | ||
|
|
d839a35340 | ||
|
|
d5a478f64a | ||
|
|
e5f3fb13ae | ||
|
|
0d8890defd | ||
|
|
016e12720d | ||
|
|
d25a926226 | ||
|
|
09fc43349f | ||
|
|
b3e305fd14 | ||
|
|
d763fad449 | ||
|
|
e877bb26c3 | ||
|
|
28fad62ccd | ||
|
|
f9d8595a25 | ||
|
|
3bf28cd427 | ||
|
|
c3032579c0 | ||
|
|
867db19bc5 | ||
|
|
cfa6a217be | ||
|
|
520ff72395 | ||
|
|
25df8b66fc | ||
|
|
d632135289 | ||
|
|
a3d443268a | ||
|
|
d03e319e35 | ||
|
|
165ec25713 | ||
|
|
35c93ee6f5 | ||
|
|
cc90426d94 | ||
|
|
6db5348daa | ||
|
|
9bf073156f | ||
|
|
8f50375cf2 | ||
|
|
451f4c1b69 | ||
|
|
95aa544275 | ||
|
|
eab73c81a7 | ||
|
|
cfc01ac9fc | ||
|
|
64d2527190 | ||
|
|
6cfea5aca3 | ||
|
|
d06c1e5f5b | ||
|
|
2cc47b0117 | ||
|
|
884cc6f8f1 | ||
|
|
2629449436 | ||
|
|
0a7e1f4185 | ||
|
|
5fdff65281 | ||
|
|
f7ccf338ad | ||
|
|
feb476c76b | ||
|
|
b258a93750 | ||
|
|
d07441e7fa |
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
language: objective-c
|
||||
xcode_project: Socket.IO-Client-Swift.xcodeproj # path to your xcodeproj folder
|
||||
xcode_scheme: SocketIO-Mac
|
||||
osx_image: xcode9.2
|
||||
osx_image: xcode10
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
# v13.4.0
|
||||
|
||||
- Add emits with write completion handlers. [#1096](https://github.com/socketio/socket.io-client-swift/issues/1096)
|
||||
- Add ability to listen for when a websocket upgrade happens
|
||||
|
||||
# v13.3.1
|
||||
|
||||
- Fixes various bugs. [#857](https://github.com/socketio/socket.io-client-swift/issues/857), [#1078](https://github.com/socketio/socket.io-client-swift/issues/1078)
|
||||
|
||||
# v13.3.0
|
||||
|
||||
- Copy cookies from polling to WebSockets ([#1057](https://github.com/socketio/socket.io-client-swift/issues/1057), [#1058](https://github.com/socketio/socket.io-client-swift/issues/1058))
|
||||
|
||||
# v13.2.1
|
||||
|
||||
- Fix packets getting lost when WebSocket upgrade fails. [#1033](https://github.com/socketio/socket.io-client-swift/issues/1033)
|
||||
- Fix bad unit tests. [#794](https://github.com/socketio/socket.io-client-swift/issues/794)
|
||||
|
||||
# v13.2.0
|
||||
|
||||
- Add ability to bypass Data inspection in emits. [#992]((https://github.com/socketio/socket.io-client-swift/issues/992))
|
||||
|
||||
+1
-3
@@ -1,3 +1 @@
|
||||
github "daltoniam/Starscream" "3.0.4"
|
||||
github "daltoniam/common-crypto-spm" "1.1.0"
|
||||
github "daltoniam/zlib-spm" "1.1.0"
|
||||
github "daltoniam/Starscream" "3.0.6"
|
||||
+2
-20
@@ -1,31 +1,13 @@
|
||||
{
|
||||
"object": {
|
||||
"pins": [
|
||||
{
|
||||
"package": "SSCommonCrypto",
|
||||
"repositoryURL": "https://github.com/daltoniam/common-crypto-spm",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "2eb3aff0fb57f92f5722fac5d6d20bf64669ca66",
|
||||
"version": "1.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"package": "Starscream",
|
||||
"repositoryURL": "https://github.com/daltoniam/Starscream",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "6cb1c474e09b0a3aa60bcdc7553b570336d6a61a",
|
||||
"version": "3.0.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"package": "SSCZLib",
|
||||
"repositoryURL": "https://github.com/daltoniam/zlib-spm.git",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "83ac8d719a2f3aa775dbdf116a57f56fb2c49abb",
|
||||
"version": "1.1.0"
|
||||
"revision": "ebdc260ea64e68f7569c62e8744b5cd15d3a49d6",
|
||||
"version": "3.0.6"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -86,7 +86,7 @@ let package = Package(
|
||||
.executable(name: "socket.io-test", targets: ["YourTargetName"])
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/socketio/socket.io-client-swift", .upToNextMinor(from: "13.2.0"))
|
||||
.package(url: "https://github.com/socketio/socket.io-client-swift", .upToNextMinor(from: "13.3.0"))
|
||||
],
|
||||
targets: [
|
||||
.target(name: "YourTargetName", dependencies: ["SocketIO"], path: "./Path/To/Your/Sources")
|
||||
@@ -99,7 +99,7 @@ Then import `import SocketIO`.
|
||||
### Carthage
|
||||
Add this line to your `Cartfile`:
|
||||
```
|
||||
github "socketio/socket.io-client-swift" ~> 13.2.0
|
||||
github "socketio/socket.io-client-swift" ~> 13.3.0
|
||||
```
|
||||
|
||||
Run `carthage update --platform ios,macosx`.
|
||||
@@ -113,7 +113,7 @@ Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
|
||||
use_frameworks!
|
||||
|
||||
target 'YourApp' do
|
||||
pod 'Socket.IO-Client-Swift', '~> 13.2.0'
|
||||
pod 'Socket.IO-Client-Swift', '~> 13.3.0'
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Socket.IO-Client-Swift"
|
||||
s.module_name = "SocketIO"
|
||||
s.version = "13.2.0"
|
||||
s.version = "13.4.0"
|
||||
s.summary = "Socket.IO-client for iOS and OS X"
|
||||
s.description = <<-DESC
|
||||
Socket.IO-client for iOS and OS X.
|
||||
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
|
||||
s.requires_arc = true
|
||||
s.source = {
|
||||
:git => "https://github.com/socketio/socket.io-client-swift.git",
|
||||
:tag => 'v13.2.0',
|
||||
:tag => 'v13.4.0',
|
||||
:submodules => true
|
||||
}
|
||||
s.pod_target_xcconfig = {
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
attributes = {
|
||||
LastSwiftMigration = 0730;
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0900;
|
||||
LastUpgradeCheck = 1000;
|
||||
TargetAttributes = {
|
||||
572EF2371B51F18A00EEBB58 = {
|
||||
CreatedOnToolsVersion = 6.4;
|
||||
@@ -523,18 +523,20 @@
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
ENABLE_BITCODE = YES;
|
||||
"ENABLE_BITCODE[sdk=macosx*]" = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@@ -596,18 +598,20 @@
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
ENABLE_BITCODE = YES;
|
||||
"ENABLE_BITCODE[sdk=macosx*]" = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
LastUpgradeVersion = "1000"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -40,7 +40,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
@@ -70,7 +69,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
@@ -75,8 +75,8 @@ public final class SocketAckEmitter : NSObject {
|
||||
|
||||
do {
|
||||
socket.emitAck(ackNum, with: try items.map({ try $0.socketRepresentation() }))
|
||||
} catch let err {
|
||||
socket.handleClientEvent(.error, data: [ackNum, items, err])
|
||||
} catch {
|
||||
socket.handleClientEvent(.error, data: [ackNum, items, error])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,21 +204,22 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
|
||||
leaveNamespace()
|
||||
}
|
||||
|
||||
/// Send an event to the server, with optional data items.
|
||||
/// Send an event to the server, with optional data items and optional write completion handler.
|
||||
///
|
||||
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
|
||||
/// will be emitted. The structure of the error data is `[eventName, items, theError]`
|
||||
///
|
||||
/// - 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...) {
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
open func emit(_ event: String, _ items: SocketData..., completion: (() -> ())? = nil) {
|
||||
do {
|
||||
try emit(event, with: items.map({ try $0.socketRepresentation() }))
|
||||
} catch let err {
|
||||
try emit(event, with: items.map({ try $0.socketRepresentation() }), completion: completion)
|
||||
} catch {
|
||||
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
|
||||
type: logType)
|
||||
|
||||
handleClientEvent(.error, data: [event, items, err])
|
||||
handleClientEvent(.error, data: [event, items, error])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +232,16 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
|
||||
emit([event] + items)
|
||||
}
|
||||
|
||||
/// Same as emit, but meant for Objective-C
|
||||
///
|
||||
/// - parameter event: The event to send.
|
||||
/// - parameter items: The items to send with this event. Send an empty array to send no data.
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
@objc
|
||||
open func emit(_ event: String, with items: [Any], completion: (() -> ())? = nil) {
|
||||
emit([event] + items, completion: completion)
|
||||
}
|
||||
|
||||
/// 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.
|
||||
@@ -253,11 +264,11 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
|
||||
open func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
|
||||
do {
|
||||
return emitWithAck(event, with: try items.map({ try $0.socketRepresentation() }))
|
||||
} catch let err {
|
||||
} catch {
|
||||
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
|
||||
type: logType)
|
||||
|
||||
handleClientEvent(.error, data: [event, items, err])
|
||||
handleClientEvent(.error, data: [event, items, error])
|
||||
|
||||
return OnAckCallback(ackNumber: -1, items: [], socket: self)
|
||||
}
|
||||
@@ -284,8 +295,22 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
|
||||
return createOnAck([event] + items)
|
||||
}
|
||||
|
||||
func emit(_ data: [Any], ack: Int? = nil, binary: Bool = true, isAck: Bool = false) {
|
||||
func emit(_ data: [Any],
|
||||
ack: Int? = nil,
|
||||
binary: Bool = true,
|
||||
isAck: Bool = false,
|
||||
completion: (() -> ())? = nil
|
||||
) {
|
||||
// wrap the completion handler so it always runs async via handlerQueue
|
||||
let wrappedCompletion: (() -> ())? = (completion == nil) ? nil : {[weak self] in
|
||||
guard let this = self else { return }
|
||||
this.manager?.handleQueue.async {
|
||||
completion!()
|
||||
}
|
||||
}
|
||||
|
||||
guard status == .connected else {
|
||||
wrappedCompletion?()
|
||||
handleClientEvent(.error, data: ["Tried emitting when not connected"])
|
||||
return
|
||||
}
|
||||
@@ -295,7 +320,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
|
||||
|
||||
DefaultSocketLogger.Logger.log("Emitting: \(str), Ack: \(isAck)", type: logType)
|
||||
|
||||
manager?.engine?.send(str, withData: packet.binary)
|
||||
manager?.engine?.send(str, withData: packet.binary, completion: wrappedCompletion)
|
||||
}
|
||||
|
||||
/// Call when you wish to tell the server that you've received the event for `ack`.
|
||||
|
||||
@@ -26,7 +26,7 @@ import Dispatch
|
||||
import Foundation
|
||||
|
||||
/// Defines the interface for a SocketIOClient.
|
||||
public protocol SocketIOClientSpec : class {
|
||||
public protocol SocketIOClientSpec : AnyObject {
|
||||
// MARK: Properties
|
||||
|
||||
/// A handler that will be called on any event.
|
||||
@@ -92,14 +92,15 @@ public protocol SocketIOClientSpec : class {
|
||||
/// Disconnects the socket.
|
||||
func disconnect()
|
||||
|
||||
/// Send an event to the server, with optional data items.
|
||||
/// Send an event to the server, with optional data items and optional write completion handler.
|
||||
///
|
||||
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
|
||||
/// will be emitted. The structure of the error data is `[eventName, items, theError]`
|
||||
///
|
||||
/// - parameter event: The event to send.
|
||||
/// - parameter items: The items to send with this event. May be left out.
|
||||
func emit(_ event: String, _ items: SocketData...)
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
func emit(_ event: String, _ items: SocketData..., completion: (() -> ())?)
|
||||
|
||||
/// Call when you wish to tell the server that you've received the event for `ack`.
|
||||
///
|
||||
@@ -334,4 +335,16 @@ public enum SocketClientEvent : String {
|
||||
/// }
|
||||
/// ```
|
||||
case statusChange
|
||||
|
||||
/// Emitted when when upgrading the http connection to a websocket connection.
|
||||
///
|
||||
/// Usage:
|
||||
///
|
||||
/// ```swift
|
||||
/// socket.on(clientEvent: .websocketUpgrade) {data, ack in
|
||||
/// let headers = (data as [Any])[0]
|
||||
/// // Some header logic
|
||||
/// }
|
||||
/// ```
|
||||
case websocketUpgrade
|
||||
}
|
||||
@@ -48,11 +48,11 @@ public final class SocketRawView : NSObject {
|
||||
public func emit(_ event: String, _ items: SocketData...) {
|
||||
do {
|
||||
try emit(event, with: items.map({ try $0.socketRepresentation() }))
|
||||
} catch let err {
|
||||
} catch {
|
||||
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
|
||||
type: "SocketIOClient")
|
||||
|
||||
socket.handleClientEvent(.error, data: [event, items, err])
|
||||
socket.handleClientEvent(.error, data: [event, items, error])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,11 +87,11 @@ public final class SocketRawView : NSObject {
|
||||
public func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
|
||||
do {
|
||||
return emitWithAck(event, with: try items.map({ try $0.socketRepresentation() }))
|
||||
} catch let err {
|
||||
} catch {
|
||||
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
|
||||
type: "SocketIOClient")
|
||||
|
||||
socket.handleClientEvent(.error, data: [event, items, err])
|
||||
socket.handleClientEvent(.error, data: [event, items, error])
|
||||
|
||||
return OnAckCallback(ackNumber: -1, items: [], socket: socket)
|
||||
}
|
||||
@@ -146,8 +146,8 @@ public final class SocketRawAckView : NSObject {
|
||||
|
||||
do {
|
||||
socket.emit(try items.map({ try $0.socketRepresentation() }), ack: ackNum, binary: false, isAck: true)
|
||||
} catch let err {
|
||||
socket.handleClientEvent(.error, data: [ackNum, items, err])
|
||||
} catch {
|
||||
socket.handleClientEvent(.error, data: [ackNum, items, error])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
/// A queue of engine.io messages waiting for POSTing
|
||||
///
|
||||
/// **You should not touch this directly**
|
||||
public var postWait = [String]()
|
||||
public var postWait = [Post]()
|
||||
|
||||
/// `true` if there is an outstanding poll. Trying to poll before the first is done will cause socket.io to
|
||||
/// disconnect us.
|
||||
@@ -281,7 +281,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
private func createWebSocketAndConnect() {
|
||||
var req = URLRequest(url: urlWebSocketWithSid)
|
||||
|
||||
addHeaders(to: &req)
|
||||
addHeaders(to: &req, includingCookies: session?.configuration.httpCookieStorage?.cookies(for: urlPollingWithSid))
|
||||
|
||||
ws = WebSocket(request: req)
|
||||
ws?.callbackQueue = engineQueue
|
||||
@@ -313,6 +313,12 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
this.parseEngineMessage(message)
|
||||
}
|
||||
|
||||
ws?.onHttpResponseHeaders = {[weak self] headers in
|
||||
guard let this = self else { return }
|
||||
|
||||
this.client?.engineDidWebsocketUpgrade(headers: headers)
|
||||
}
|
||||
|
||||
ws?.connect()
|
||||
}
|
||||
|
||||
@@ -340,7 +346,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
if polling {
|
||||
disconnectPolling(reason: reason)
|
||||
} else {
|
||||
sendWebSocketMessage("", withType: .close, withData: [])
|
||||
sendWebSocketMessage("", withType: .close, withData: [], completion: nil)
|
||||
closeOutEngine(reason: reason)
|
||||
}
|
||||
}
|
||||
@@ -348,7 +354,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
// 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) {
|
||||
postWait.append(String(SocketEnginePacketType.close.rawValue))
|
||||
postWait.append((String(SocketEnginePacketType.close.rawValue), {}))
|
||||
|
||||
doRequest(for: createRequestForPostWithPostWait()) {_, _, _ in }
|
||||
closeOutEngine(reason: reason)
|
||||
@@ -366,25 +372,28 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
|
||||
DefaultSocketLogger.Logger.log("Switching to WebSockets", type: SocketEngine.logType)
|
||||
|
||||
sendWebSocketMessage("", withType: .upgrade, withData: [])
|
||||
sendWebSocketMessage("", withType: .upgrade, withData: [], completion: nil)
|
||||
polling = false
|
||||
fastUpgrade = false
|
||||
probing = false
|
||||
flushProbeWait()
|
||||
|
||||
// Need to flush postWait to socket since it connected successfully
|
||||
// moved from flushProbeWait() since it is also called on connected failure, and we don't want to try and send
|
||||
// packets through WebSockets when WebSockets has failed!
|
||||
if !postWait.isEmpty {
|
||||
flushWaitingForPostToWebSocket()
|
||||
}
|
||||
}
|
||||
|
||||
private func flushProbeWait() {
|
||||
DefaultSocketLogger.Logger.log("Flushing probe wait", type: SocketEngine.logType)
|
||||
|
||||
for waiter in probeWait {
|
||||
write(waiter.msg, withType: waiter.type, withData: waiter.data)
|
||||
write(waiter.msg, withType: waiter.type, withData: waiter.data, completion: waiter.completion)
|
||||
}
|
||||
|
||||
probeWait.removeAll(keepingCapacity: false)
|
||||
|
||||
if postWait.count != 0 {
|
||||
flushWaitingForPostToWebSocket()
|
||||
}
|
||||
}
|
||||
|
||||
/// Causes any packets that were waiting for POSTing to be sent through the WebSocket. This happens because when
|
||||
@@ -395,7 +404,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
guard let ws = self.ws else { return }
|
||||
|
||||
for msg in postWait {
|
||||
ws.write(string: msg)
|
||||
ws.write(string: msg.msg, completion: msg.completion)
|
||||
}
|
||||
|
||||
postWait.removeAll(keepingCapacity: false)
|
||||
@@ -541,9 +550,9 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
}
|
||||
|
||||
pongsMissed += 1
|
||||
write("", withType: .ping, withData: [])
|
||||
write("", withType: .ping, withData: [], completion: nil)
|
||||
|
||||
engineQueue.asyncAfter(deadline: DispatchTime.now() + .milliseconds(pingInterval)) {[weak self, id = self.sid] in
|
||||
engineQueue.asyncAfter(deadline: .now() + .milliseconds(pingInterval)) {[weak self, id = self.sid] in
|
||||
// Make sure not to ping old connections
|
||||
guard let this = self, this.sid == id else { return }
|
||||
|
||||
@@ -597,7 +606,7 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
DefaultSocketLogger.Logger.log("Upgrading transport to WebSockets", type: SocketEngine.logType)
|
||||
|
||||
fastUpgrade = true
|
||||
sendPollMessage("", withType: .noop, withData: [])
|
||||
sendPollMessage("", withType: .noop, withData: [], completion: nil)
|
||||
// After this point, we should not send anymore polling messages
|
||||
}
|
||||
}
|
||||
@@ -607,11 +616,15 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
/// - parameter msg: The message to send.
|
||||
/// - parameter type: The type of this message.
|
||||
/// - parameter data: Any data that this message has.
|
||||
open func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) {
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
open func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: (() -> ())? = nil) {
|
||||
engineQueue.async {
|
||||
guard self.connected else { return }
|
||||
guard self.connected else {
|
||||
completion?()
|
||||
return
|
||||
}
|
||||
guard !self.probing else {
|
||||
self.probeWait.append((msg, type, data))
|
||||
self.probeWait.append((msg, type, data, completion))
|
||||
|
||||
return
|
||||
}
|
||||
@@ -619,11 +632,11 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
if self.polling {
|
||||
DefaultSocketLogger.Logger.log("Writing poll: \(msg) has data: \(data.count != 0)",
|
||||
type: SocketEngine.logType)
|
||||
self.sendPollMessage(msg, withType: type, withData: data)
|
||||
self.sendPollMessage(msg, withType: type, withData: data, completion: completion)
|
||||
} else {
|
||||
DefaultSocketLogger.Logger.log("Writing ws: \(msg) has data: \(data.count != 0)",
|
||||
type: SocketEngine.logType)
|
||||
self.sendWebSocketMessage(msg, withType: type, withData: data)
|
||||
self.sendWebSocketMessage(msg, withType: type, withData: data, completion: completion)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -659,7 +672,9 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
|
||||
connected = false
|
||||
polling = true
|
||||
|
||||
if let reason = error?.localizedDescription {
|
||||
if let error = error as? WSError {
|
||||
didError(reason: "\(error.message). code=\(error.code), type=\(error.type)")
|
||||
} else if let reason = error?.localizedDescription {
|
||||
didError(reason: reason)
|
||||
} else {
|
||||
client?.engineDidClose(reason: "Socket Disconnected")
|
||||
|
||||
@@ -59,4 +59,9 @@ import Foundation
|
||||
///
|
||||
/// - parameter data: The data the engine received.
|
||||
func parseEngineBinaryData(_ data: Data)
|
||||
|
||||
/// Called when when upgrading the http connection to a websocket connection.
|
||||
///
|
||||
/// - parameter headers: The http headers.
|
||||
func engineDidWebsocketUpgrade(headers: [String: String])
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public protocol SocketEnginePollable : SocketEngineSpec {
|
||||
/// A queue of engine.io messages waiting for POSTing
|
||||
///
|
||||
/// **You should not touch this directly**
|
||||
var postWait: [String] { get set }
|
||||
var postWait: [Post] { get set }
|
||||
|
||||
/// The URLSession that will be used for polling.
|
||||
var session: URLSession? { get }
|
||||
@@ -65,7 +65,7 @@ public protocol SocketEnginePollable : SocketEngineSpec {
|
||||
/// - 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])
|
||||
func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: (() -> ())?)
|
||||
|
||||
/// Call to stop polling and invalidate the URLSession.
|
||||
func stopPolling()
|
||||
@@ -74,12 +74,15 @@ public protocol SocketEnginePollable : SocketEngineSpec {
|
||||
// Default polling methods
|
||||
extension SocketEnginePollable {
|
||||
func createRequestForPostWithPostWait() -> URLRequest {
|
||||
defer { postWait.removeAll(keepingCapacity: true) }
|
||||
defer {
|
||||
for packet in postWait { packet.completion?() }
|
||||
postWait.removeAll(keepingCapacity: true)
|
||||
}
|
||||
|
||||
var postStr = ""
|
||||
|
||||
for packet in postWait {
|
||||
postStr += "\(packet.utf16.count):\(packet)"
|
||||
postStr += "\(packet.msg.utf16.count):\(packet.msg)"
|
||||
}
|
||||
|
||||
DefaultSocketLogger.Logger.log("Created POST string: \(postStr)", type: "SocketEnginePolling")
|
||||
@@ -122,9 +125,12 @@ extension SocketEnginePollable {
|
||||
|
||||
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")
|
||||
guard let data = data, let res = res as? HTTPURLResponse, res.statusCode == 200 else {
|
||||
if let err = err {
|
||||
DefaultSocketLogger.Logger.error(err.localizedDescription, type: "SocketEnginePolling")
|
||||
} else {
|
||||
DefaultSocketLogger.Logger.error("Error during long poll request", type: "SocketEnginePolling")
|
||||
}
|
||||
|
||||
if this.polling {
|
||||
this.didError(reason: err?.localizedDescription ?? "Error")
|
||||
@@ -135,7 +141,7 @@ extension SocketEnginePollable {
|
||||
|
||||
DefaultSocketLogger.Logger.log("Got polling response", type: "SocketEnginePolling")
|
||||
|
||||
if let str = String(data: data!, encoding: .utf8) {
|
||||
if let str = String(data: data, encoding: .utf8) {
|
||||
this.parsePollingMessage(str)
|
||||
}
|
||||
|
||||
@@ -163,11 +169,14 @@ extension SocketEnginePollable {
|
||||
|
||||
DefaultSocketLogger.Logger.log("POSTing", type: "SocketEnginePolling")
|
||||
|
||||
doRequest(for: req) {[weak self] data, res, err in
|
||||
doRequest(for: req) {[weak self] _, res, err in
|
||||
guard let this = self else { return }
|
||||
|
||||
if err != nil {
|
||||
DefaultSocketLogger.Logger.error(err?.localizedDescription ?? "Error", type: "SocketEnginePolling")
|
||||
guard let res = res as? HTTPURLResponse, res.statusCode == 200 else {
|
||||
if let err = err {
|
||||
DefaultSocketLogger.Logger.error(err.localizedDescription, type: "SocketEnginePolling")
|
||||
} else {
|
||||
DefaultSocketLogger.Logger.error("Error flushing waiting posts", type: "SocketEnginePolling")
|
||||
}
|
||||
|
||||
if this.polling {
|
||||
this.didError(reason: err?.localizedDescription ?? "Error")
|
||||
@@ -209,14 +218,15 @@ extension SocketEnginePollable {
|
||||
/// - 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]) {
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
public func sendPollMessage(_ message: String, withType type: SocketEnginePacketType, withData datas: [Data], completion: (() -> ())? = nil) {
|
||||
DefaultSocketLogger.Logger.log("Sending poll: \(message) as type: \(type.rawValue)", type: "SocketEnginePolling")
|
||||
|
||||
postWait.append(String(type.rawValue) + message)
|
||||
postWait.append((String(type.rawValue) + message, completion))
|
||||
|
||||
for data in datas {
|
||||
if case let .right(bin) = createBinaryDataForSend(using: data) {
|
||||
postWait.append(bin)
|
||||
postWait.append((bin, {}))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,8 @@ import Starscream
|
||||
/// - parameter msg: The message to send.
|
||||
/// - parameter type: The type of this message.
|
||||
/// - parameter data: Any data that this message has.
|
||||
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data])
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: (() -> ())?)
|
||||
}
|
||||
|
||||
extension SocketEngineSpec {
|
||||
@@ -155,9 +156,12 @@ extension SocketEngineSpec {
|
||||
return com.url!
|
||||
}
|
||||
|
||||
func addHeaders(to req: inout URLRequest) {
|
||||
if let cookies = cookies {
|
||||
req.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookies)
|
||||
func addHeaders(to req: inout URLRequest, includingCookies additionalCookies: [HTTPCookie]? = nil) {
|
||||
var cookiesToAdd: [HTTPCookie] = cookies ?? []
|
||||
cookiesToAdd += additionalCookies ?? []
|
||||
|
||||
if !cookiesToAdd.isEmpty {
|
||||
req.allHTTPHeaderFields = HTTPCookie.requestHeaderFields(with: cookiesToAdd)
|
||||
}
|
||||
|
||||
if let extraHeaders = extraHeaders {
|
||||
@@ -176,7 +180,7 @@ extension SocketEngineSpec {
|
||||
}
|
||||
|
||||
/// Send an engine message (4)
|
||||
func send(_ msg: String, withData datas: [Data]) {
|
||||
write(msg, withType: .message, withData: datas)
|
||||
func send(_ msg: String, withData datas: [Data], completion: (() -> ())? = nil) {
|
||||
write(msg, withType: .message, withData: datas, completion: completion)
|
||||
}
|
||||
}
|
||||
@@ -37,14 +37,18 @@ public protocol SocketEngineWebsocket : SocketEngineSpec {
|
||||
/// - 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])
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
func sendWebSocketMessage(_ str: String,
|
||||
withType type: SocketEnginePacketType,
|
||||
withData datas: [Data],
|
||||
completion: (() -> ())?)
|
||||
}
|
||||
|
||||
// WebSocket methods
|
||||
extension SocketEngineWebsocket {
|
||||
func probeWebSocket() {
|
||||
if ws?.isConnected ?? false {
|
||||
sendWebSocketMessage("probe", withType: .ping, withData: [])
|
||||
sendWebSocketMessage("probe", withType: .ping, withData: [], completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,14 +59,19 @@ extension SocketEngineWebsocket {
|
||||
/// - 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]) {
|
||||
/// - parameter completion: Callback called on transport write completion.
|
||||
public func sendWebSocketMessage(_ str: String,
|
||||
withType type: SocketEnginePacketType,
|
||||
withData datas: [Data],
|
||||
completion: (() -> ())?
|
||||
) {
|
||||
DefaultSocketLogger.Logger.log("Sending ws: \(str) as type: \(type.rawValue)", type: "SocketEngineWebSocket")
|
||||
|
||||
ws?.write(string: "\(type.rawValue)\(str)")
|
||||
|
||||
for data in datas {
|
||||
if case let .left(bin) = createBinaryDataForSend(using: data) {
|
||||
ws?.write(data: bin)
|
||||
ws?.write(data: bin, completion: completion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,10 +137,6 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
self._config = config
|
||||
self.socketURL = socketURL
|
||||
|
||||
if socketURL.absoluteString.hasPrefix("https://") {
|
||||
self._config.insert(.secure(true))
|
||||
}
|
||||
|
||||
super.init()
|
||||
|
||||
setConfigs(_config)
|
||||
@@ -169,6 +165,9 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
|
||||
engine?.engineQueue.sync {
|
||||
self.engine?.client = nil
|
||||
|
||||
// Close old engine so it will not leak because of URLSession if in polling mode
|
||||
self.engine?.disconnect(reason: "Adding new engine")
|
||||
}
|
||||
|
||||
engine = SocketEngine(client: self, url: socketURL, config: config)
|
||||
@@ -287,7 +286,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
/// - parameter items: The data to send with this event.
|
||||
open func emitAll(_ event: String, withItems items: [Any]) {
|
||||
forAll {socket in
|
||||
socket.emit(event, with: items)
|
||||
socket.emit(event, with: items, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +377,18 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
}
|
||||
}
|
||||
|
||||
/// Called when when upgrading the http connection to a websocket connection.
|
||||
///
|
||||
/// - parameter headers: The http headers.
|
||||
open func engineDidWebsocketUpgrade(headers: [String: String]) {
|
||||
handleQueue.async {
|
||||
self._engineDidWebsocketUpgrade(headers: headers)
|
||||
}
|
||||
}
|
||||
private func _engineDidWebsocketUpgrade(headers: [String: String]) {
|
||||
emitAll(clientEvent: .websocketUpgrade, data: [headers])
|
||||
}
|
||||
|
||||
/// Called when the engine has a message that must be parsed.
|
||||
///
|
||||
/// - parameter msg: The message that needs parsing.
|
||||
@@ -389,7 +400,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
|
||||
private func _parseEngineMessage(_ msg: String) {
|
||||
guard let packet = parseSocketMessage(msg) else { return }
|
||||
guard packet.type != .binaryAck && packet.type != .binaryEvent else {
|
||||
guard !packet.type.isBinary else {
|
||||
waitingPackets.append(packet)
|
||||
|
||||
return
|
||||
@@ -486,12 +497,17 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
DefaultSocketLogger.Logger.log = log
|
||||
case let .logger(logger):
|
||||
DefaultSocketLogger.Logger = logger
|
||||
default:
|
||||
case _:
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
_config = config
|
||||
|
||||
if socketURL.absoluteString.hasPrefix("https://") {
|
||||
_config.insert(.secure(true))
|
||||
}
|
||||
|
||||
_config.insert(.path("/socket.io/"), replacing: false)
|
||||
|
||||
// If `ConfigSettable` & `SocketEngineSpec`, update its configs.
|
||||
|
||||
@@ -46,7 +46,7 @@ import Foundation
|
||||
/// or call one of the `disconnectSocket` methods on this class.
|
||||
///
|
||||
@objc
|
||||
public protocol SocketManagerSpec : class, SocketEngineClient {
|
||||
public protocol SocketManagerSpec : AnyObject, SocketEngineClient {
|
||||
// MARK: Properties
|
||||
|
||||
/// Returns the socket associated with the default namespace ("/").
|
||||
|
||||
@@ -116,7 +116,7 @@ public struct SocketPacket : CustomStringConvertible {
|
||||
private func createPacketString() -> String {
|
||||
let typeString = String(type.rawValue)
|
||||
// Binary count?
|
||||
let binaryCountString = typeString + (type == .binaryEvent || type == .binaryAck ? "\(String(binary.count))-" : "")
|
||||
let binaryCountString = typeString + (type.isBinary ? "\(String(binary.count))-" : "")
|
||||
// Namespace?
|
||||
let nspString = binaryCountString + (nsp != "/" ? "\(nsp)," : "")
|
||||
// Ack number?
|
||||
@@ -181,6 +181,13 @@ public extension SocketPacket {
|
||||
|
||||
/// Binary Ack: 6
|
||||
case binaryAck
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
/// Whether or not this type is binary
|
||||
public var isBinary: Bool {
|
||||
return self == .binaryAck || self == .binaryEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
import Foundation
|
||||
|
||||
/// Defines that a type will be able to parse socket.io-protocol messages.
|
||||
public protocol SocketParsable : class {
|
||||
public protocol SocketParsable : AnyObject {
|
||||
// MARK: Methods
|
||||
|
||||
/// Called when the engine has received some binary data that should be attached to a packet.
|
||||
@@ -57,7 +57,7 @@ public enum SocketParsableError : Error {
|
||||
}
|
||||
|
||||
/// Says that a type will be able to buffer binary data before all data for an event has come in.
|
||||
public protocol SocketDataBufferable : class {
|
||||
public protocol SocketDataBufferable : AnyObject {
|
||||
// MARK: Properties
|
||||
|
||||
/// A list of packets that are waiting for binary data.
|
||||
@@ -77,7 +77,7 @@ public extension SocketParsable where Self: SocketManagerSpec & SocketDataBuffer
|
||||
internal func parseString(_ message: String) throws -> SocketPacket {
|
||||
var reader = SocketStringReader(message: message)
|
||||
|
||||
guard let type = Int(reader.read(count: 1)).flatMap({ SocketPacket.PacketType(rawValue: $0) }) else {
|
||||
guard let type = Int(reader.read(count: 1)).flatMap({ SocketPacket.PacketType(rawValue: $0) }) else {
|
||||
throw SocketParsableError.invalidPacketType
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public extension SocketParsable where Self: SocketManagerSpec & SocketDataBuffer
|
||||
var namespace = "/"
|
||||
var placeholders = -1
|
||||
|
||||
if type == .binaryEvent || type == .binaryAck {
|
||||
if type.isBinary {
|
||||
if let holders = Int(reader.readUntilOccurence(of: "-")) {
|
||||
placeholders = holders
|
||||
} else {
|
||||
@@ -109,14 +109,11 @@ public extension SocketParsable where Self: SocketManagerSpec & SocketDataBuffer
|
||||
if type == .error {
|
||||
reader.advance(by: -1)
|
||||
} else {
|
||||
while reader.hasNext {
|
||||
if let int = Int(reader.read(count: 1)) {
|
||||
idString += String(int)
|
||||
} else {
|
||||
reader.advance(by: -2)
|
||||
break
|
||||
}
|
||||
while let int = Int(reader.read(count: 1)) {
|
||||
idString += String(int)
|
||||
}
|
||||
|
||||
reader.advance(by: -2)
|
||||
}
|
||||
|
||||
var dataArray = String(message.utf16[message.utf16.index(reader.currentIndex, offsetBy: 1)...])!
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import Foundation
|
||||
|
||||
/// Represents a class will log client events.
|
||||
public protocol SocketLogger : class {
|
||||
public protocol SocketLogger : AnyObject {
|
||||
// MARK: Properties
|
||||
|
||||
/// Whether to log or not
|
||||
|
||||
@@ -73,8 +73,11 @@ public typealias AckCallback = ([Any]) -> ()
|
||||
/// A typealias for a normal callback.
|
||||
public typealias NormalCallback = ([Any], SocketAckEmitter) -> ()
|
||||
|
||||
/// A typealias for a queued POST
|
||||
public typealias Post = (msg: String, completion: (() -> ())?)
|
||||
|
||||
typealias JSON = [String: Any]
|
||||
typealias Probe = (msg: String, type: SocketEnginePacketType, data: [Data])
|
||||
typealias Probe = (msg: String, type: SocketEnginePacketType, data: [Data], completion: (() -> ())?)
|
||||
typealias ProbeWaitQueue = [Probe]
|
||||
|
||||
enum Either<E, V> {
|
||||
|
||||
@@ -9,143 +9,180 @@
|
||||
import XCTest
|
||||
@testable import SocketIO
|
||||
|
||||
class SocketBasicPacketTest: XCTestCase {
|
||||
let data = "test".data(using: String.Encoding.utf8)!
|
||||
let data2 = "test2".data(using: String.Encoding.utf8)!
|
||||
|
||||
func testEmpyEmit() {
|
||||
let expectedSendString = "2[\"test\"]"
|
||||
class SocketBasicPacketTest : XCTestCase {
|
||||
func testEmptyEmit() {
|
||||
let sendData = ["test"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testNullEmit() {
|
||||
let expectedSendString = "2[\"test\",null]"
|
||||
let sendData: [Any] = ["test", NSNull()]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testStringEmit() {
|
||||
let expectedSendString = "2[\"test\",\"foo bar\"]"
|
||||
let sendData = ["test", "foo bar"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testStringEmitWithQuotes() {
|
||||
let expectedSendString = "2[\"test\",\"\\\"he\\\"llo world\\\"\"]"
|
||||
let sendData = ["test", "\"he\"llo world\""]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testJSONEmit() {
|
||||
let expectedSendString = "2[\"test\",{\"null\":null,\"hello\":1,\"test\":\"hello\",\"foobar\":true}]"
|
||||
let sendData: [Any] = ["test", ["foobar": true, "hello": 1, "test": "hello", "null": NSNull()]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testArrayEmit() {
|
||||
let expectedSendString = "2[\"test\",[\"hello\",1,{\"test\":\"test\"}]]"
|
||||
let sendData: [Any] = ["test", ["hello", 1, ["test": "test"]]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testBinaryEmit() {
|
||||
let expectedSendString = "51-[\"test\",{\"_placeholder\":true,\"num\":0}]"
|
||||
let sendData: [Any] = ["test", data]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .binaryEvent)
|
||||
XCTAssertEqual(packet.binary, [data])
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: [
|
||||
"test",
|
||||
["_placeholder": true, "num": 0]
|
||||
]))
|
||||
}
|
||||
|
||||
func testMultipleBinaryEmit() {
|
||||
let expectedSendString = "52-[\"test\",{\"data2\":{\"_placeholder\":true,\"num\":0},\"data1\":{\"_placeholder\":true,\"num\":1}}]"
|
||||
let sendData: [Any] = ["test", ["data1": data, "data2": data2] as NSDictionary]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/", ack: false)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(packet.binary, [data2, data])
|
||||
XCTAssertEqual(parsed.type, .binaryEvent)
|
||||
|
||||
let binaryObj = parsed.data[1] as! [String: Any]
|
||||
let data1Loc = (binaryObj["data1"] as! [String: Any])["num"] as! Int
|
||||
let data2Loc = (binaryObj["data2"] as! [String: Any])["num"] as! Int
|
||||
|
||||
XCTAssertEqual(packet.binary[data1Loc], data)
|
||||
XCTAssertEqual(packet.binary[data2Loc], data2)
|
||||
}
|
||||
|
||||
func testEmitWithAck() {
|
||||
let expectedSendString = "20[\"test\"]"
|
||||
let sendData = ["test"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: false)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: false).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString,
|
||||
|
||||
expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testEmitDataWithAck() {
|
||||
let expectedSendString = "51-0[\"test\",{\"_placeholder\":true,\"num\":0}]"
|
||||
let sendData: [Any] = ["test", data]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: false)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .binaryEvent)
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: [
|
||||
"test",
|
||||
["_placeholder": true, "num": 0]
|
||||
]))
|
||||
XCTAssertEqual(packet.binary, [data])
|
||||
}
|
||||
|
||||
// Acks
|
||||
func testEmptyAck() {
|
||||
let expectedSendString = "30[]"
|
||||
let packet = SocketPacket.packetFromEmit([], id: 0, nsp: "/", ack: true)
|
||||
let packetStr = SocketPacket.packetFromEmit([], id: 0, nsp: "/", ack: true).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: []))
|
||||
}
|
||||
|
||||
func testNullAck() {
|
||||
let expectedSendString = "30[null]"
|
||||
let sendData = [NSNull()]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testStringAck() {
|
||||
let expectedSendString = "30[\"test\"]"
|
||||
let sendData = ["test"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testJSONAck() {
|
||||
let expectedSendString = "30[{\"null\":null,\"hello\":1,\"test\":\"hello\",\"foobar\":true}]"
|
||||
let sendData = [["foobar": true, "hello": 1, "test": "hello", "null": NSNull()]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true)
|
||||
let packetStr = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true).packetString
|
||||
let parsed = parser.parseSocketMessage(packetStr)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
func testBinaryAck() {
|
||||
let expectedSendString = "61-0[{\"_placeholder\":true,\"num\":0}]"
|
||||
let sendData = [data]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(parsed.type, .binaryAck)
|
||||
XCTAssertEqual(packet.binary, [data])
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: [
|
||||
["_placeholder": true, "num": 0]
|
||||
]))
|
||||
}
|
||||
|
||||
func testMultipleBinaryAck() {
|
||||
let expectedSendString = "62-0[{\"data2\":{\"_placeholder\":true,\"num\":0},\"data1\":{\"_placeholder\":true,\"num\":1}}]"
|
||||
let sendData = [["data1": data, "data2": data2]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/", ack: true)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(packet.binary, [data2, data])
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertEqual(parsed.type, .binaryAck)
|
||||
|
||||
let binaryObj = parsed.data[0] as! [String: Any]
|
||||
let data1Loc = (binaryObj["data1"] as! [String: Any])["num"] as! Int
|
||||
let data2Loc = (binaryObj["data2"] as! [String: Any])["num"] as! Int
|
||||
|
||||
XCTAssertEqual(packet.binary[data1Loc], data)
|
||||
XCTAssertEqual(packet.binary[data2Loc], data2)
|
||||
}
|
||||
|
||||
func testBinaryStringPlaceholderInMessage() {
|
||||
@@ -159,4 +196,20 @@ class SocketBasicPacketTest: XCTestCase {
|
||||
_ = packet.addData(data2)
|
||||
XCTAssertEqual(packet.args[0] as? String, "~~0")
|
||||
}
|
||||
|
||||
private func compareAnyArray(input: [Any], expected: [Any]) -> Bool {
|
||||
guard input.count == expected.count else { return false }
|
||||
|
||||
return (input as NSArray).isEqual(to: expected)
|
||||
}
|
||||
|
||||
let data = "test".data(using: String.Encoding.utf8)!
|
||||
let data2 = "test2".data(using: String.Encoding.utf8)!
|
||||
var parser: SocketParsable!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
parser = SocketManager(socketURL: URL(string: "http://localhost")!)
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,16 @@ class SocketMangerTest : XCTestCase {
|
||||
XCTAssertEqual(manager.status, .notConnected)
|
||||
}
|
||||
|
||||
func testSettingConfig() {
|
||||
let manager = SocketManager(socketURL: URL(string: "https://example.com/")!)
|
||||
|
||||
XCTAssertEqual(manager.config.first!, .secure(true))
|
||||
|
||||
manager.config = []
|
||||
|
||||
XCTAssertEqual(manager.config.first!, .secure(true))
|
||||
}
|
||||
|
||||
func testManagerCallsConnect() {
|
||||
setUpSockets()
|
||||
|
||||
@@ -188,7 +198,7 @@ public class TestSocket : SocketIOClient {
|
||||
super.didDisconnect(reason: reason)
|
||||
}
|
||||
|
||||
public override func emit(_ event: String, with items: [Any]) {
|
||||
public override func emit(_ event: String, with items: [Any], completion: (() -> ())?) {
|
||||
expectations[ManagerExpectation.emitAllEventCalled]?.fulfill()
|
||||
expectations[ManagerExpectation.emitAllEventCalled] = nil
|
||||
|
||||
|
||||
@@ -9,133 +9,198 @@
|
||||
import XCTest
|
||||
@testable import SocketIO
|
||||
|
||||
class SocketNamespacePacketTest: XCTestCase {
|
||||
let data = "test".data(using: String.Encoding.utf8)!
|
||||
let data2 = "test2".data(using: String.Encoding.utf8)!
|
||||
|
||||
func testEmpyEmit() {
|
||||
let expectedSendString = "2/swift,[\"test\"]"
|
||||
class SocketNamespacePacketTest : XCTestCase {
|
||||
func testEmptyEmit() {
|
||||
let sendData: [Any] = ["test"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testNullEmit() {
|
||||
let expectedSendString = "2/swift,[\"test\",null]"
|
||||
let sendData: [Any] = ["test", NSNull()]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testStringEmit() {
|
||||
let expectedSendString = "2/swift,[\"test\",\"foo bar\"]"
|
||||
let sendData: [Any] = ["test", "foo bar"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testJSONEmit() {
|
||||
let expectedSendString = "2/swift,[\"test\",{\"null\":null,\"test\":\"hello\",\"hello\":1,\"foobar\":true}]"
|
||||
let sendData: [Any] = ["test", ["foobar": true, "hello": 1, "test": "hello", "null": NSNull()] as NSDictionary]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testArrayEmit() {
|
||||
let expectedSendString = "2/swift,[\"test\",[\"hello\",1,{\"test\":\"test\"},true]]"
|
||||
let sendData: [Any] = ["test", ["hello", 1, ["test": "test"], true]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testBinaryEmit() {
|
||||
let expectedSendString = "51-/swift,[\"test\",{\"_placeholder\":true,\"num\":0}]"
|
||||
let sendData: [Any] = ["test", data]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .binaryEvent)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(packet.binary, [data])
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: [
|
||||
"test",
|
||||
["_placeholder": true, "num": 0]
|
||||
]))
|
||||
}
|
||||
|
||||
|
||||
func testMultipleBinaryEmit() {
|
||||
let expectedSendString = "52-/swift,[\"test\",{\"data2\":{\"_placeholder\":true,\"num\":0},\"data1\":{\"_placeholder\":true,\"num\":1}}]"
|
||||
let sendData: [Any] = ["test", ["data1": data, "data2": data2] as NSDictionary]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: -1, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(packet.binary, [data2, data])
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .binaryEvent)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
|
||||
let binaryObj = parsed.data[1] as! [String: Any]
|
||||
let data1Loc = (binaryObj["data1"] as! [String: Any])["num"] as! Int
|
||||
let data2Loc = (binaryObj["data2"] as! [String: Any])["num"] as! Int
|
||||
|
||||
XCTAssertEqual(packet.binary[data1Loc], data)
|
||||
XCTAssertEqual(packet.binary[data2Loc], data2)
|
||||
}
|
||||
|
||||
|
||||
func testEmitWithAck() {
|
||||
let expectedSendString = "2/swift,0[\"test\"]"
|
||||
let sendData = ["test"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .event)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testEmitDataWithAck() {
|
||||
let expectedSendString = "51-/swift,0[\"test\",{\"_placeholder\":true,\"num\":0}]"
|
||||
let sendData: [Any] = ["test", data]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: false)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(packet.binary, [data])
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .binaryEvent)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: [
|
||||
"test",
|
||||
["_placeholder": true, "num": 0]
|
||||
]))
|
||||
}
|
||||
|
||||
|
||||
// Acks
|
||||
func testEmptyAck() {
|
||||
let expectedSendString = "3/swift,0[]"
|
||||
let packet = SocketPacket.packetFromEmit([], id: 0, nsp: "/swift", ack: true)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
}
|
||||
|
||||
|
||||
func testNullAck() {
|
||||
let expectedSendString = "3/swift,0[null]"
|
||||
let sendData = [NSNull()]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: true)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testStringAck() {
|
||||
let expectedSendString = "3/swift,0[\"test\"]"
|
||||
let sendData = ["test"]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: true)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testJSONAck() {
|
||||
let expectedSendString = "3/swift,0[{\"null\":null,\"hello\":1,\"test\":\"hello\",\"foobar\":true}]"
|
||||
let sendData = [["foobar": true, "hello": 1, "test": "hello", "null": NSNull()]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: true)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .ack)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: sendData))
|
||||
}
|
||||
|
||||
|
||||
func testBinaryAck() {
|
||||
let expectedSendString = "61-/swift,0[{\"_placeholder\":true,\"num\":0}]"
|
||||
let sendData = [data]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: true)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(packet.binary, [data])
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .binaryAck)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
XCTAssertTrue(compareAnyArray(input: parsed.data, expected: [
|
||||
["_placeholder": true, "num": 0]
|
||||
]))
|
||||
}
|
||||
|
||||
|
||||
func testMultipleBinaryAck() {
|
||||
let expectedSendString = "62-/swift,0[{\"data2\":{\"_placeholder\":true,\"num\":0},\"data1\":{\"_placeholder\":true,\"num\":1}}]"
|
||||
let sendData = [["data1": data, "data2": data2]]
|
||||
let packet = SocketPacket.packetFromEmit(sendData, id: 0, nsp: "/swift", ack: true)
|
||||
|
||||
XCTAssertEqual(packet.packetString, expectedSendString)
|
||||
XCTAssertEqual(packet.binary, [data2, data])
|
||||
let parsed = parser.parseSocketMessage(packet.packetString)!
|
||||
|
||||
XCTAssertEqual(parsed.type, .binaryAck)
|
||||
XCTAssertEqual(parsed.nsp, "/swift")
|
||||
XCTAssertEqual(parsed.id, 0)
|
||||
|
||||
let binaryObj = parsed.data[0] as! [String: Any]
|
||||
let data1Loc = (binaryObj["data1"] as! [String: Any])["num"] as! Int
|
||||
let data2Loc = (binaryObj["data2"] as! [String: Any])["num"] as! Int
|
||||
|
||||
XCTAssertEqual(packet.binary[data1Loc], data)
|
||||
XCTAssertEqual(packet.binary[data2Loc], data2)
|
||||
}
|
||||
|
||||
let data = "test".data(using: String.Encoding.utf8)!
|
||||
let data2 = "test2".data(using: String.Encoding.utf8)!
|
||||
var parser: SocketParsable!
|
||||
|
||||
private func compareAnyArray(input: [Any], expected: [Any]) -> Bool {
|
||||
guard input.count == expected.count else { return false }
|
||||
|
||||
return (input as NSArray).isEqual(to: expected)
|
||||
}
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
parser = SocketManager(socketURL: URL(string: "http://localhost")!)
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,11 @@ class SocketSideEffectTest: XCTestCase {
|
||||
XCTAssertEqual(socket.currentAck, 1)
|
||||
}
|
||||
|
||||
func testEmitCompletionSyntax() {
|
||||
socket.emit("test", completion: {})
|
||||
socket.emit("test", "thing", completion: {})
|
||||
}
|
||||
|
||||
func testHandleAck() {
|
||||
let expect = expectation(description: "handled ack")
|
||||
socket.emitWithAck("test").timingOut(after: 0) {data in
|
||||
@@ -506,5 +511,5 @@ class TestEngine : SocketEngineSpec {
|
||||
func flushWaitingForPostToWebSocket() { }
|
||||
func parseEngineData(_ data: Data) { }
|
||||
func parseEngineMessage(_ message: String) { }
|
||||
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) { }
|
||||
func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data], completion: (() -> ())?) { }
|
||||
}
|
||||
@@ -13,9 +13,18 @@
|
||||
|
||||
- (void)testSettingConfig {
|
||||
NSURL* url = [[NSURL alloc] initWithString:@"http://localhost"];
|
||||
self.manager = [[TestManager alloc] initWithSocketURL:url config:@{@"forceNew": @YES}];
|
||||
NSDictionary* headers = @{@"My Header": @"Some Value"};
|
||||
|
||||
self.manager = [[TestManager alloc] initWithSocketURL:url config:@{
|
||||
@"forceNew": @YES,
|
||||
@"extraHeaders": headers
|
||||
}];
|
||||
|
||||
[self.manager connect];
|
||||
|
||||
XCTAssertTrue(self.manager.forceNew);
|
||||
XCTAssertTrue([self.manager.engine.extraHeaders isEqualToDictionary:headers]);
|
||||
|
||||
}
|
||||
|
||||
- (void)testManagerProperties {
|
||||
|
||||
@@ -67,6 +67,20 @@
|
||||
[self.socket emit:@"testEmit" with:@[@YES]];
|
||||
}
|
||||
|
||||
- (void)testEmitWriteCompletionSyntax {
|
||||
[self.socket emit:@"testEmit" with:@[@YES] completion:^{}];
|
||||
}
|
||||
|
||||
- (void)testEmitWriteCompletion {
|
||||
XCTestExpectation* expect = [self expectationWithDescription:@"Write completion should be called"];
|
||||
|
||||
[self.socket emit:@"testEmit" with:@[@YES] completion:^{
|
||||
[expect fulfill];
|
||||
}];
|
||||
|
||||
[self waitForExpectationsWithTimeout:0.3 handler:nil];
|
||||
}
|
||||
|
||||
- (void)testRawEmitSyntax {
|
||||
[[self.socket rawEmitView] emit:@"myEvent" with:@[@1]];
|
||||
}
|
||||
|
||||
@@ -104,6 +104,6 @@ will fire a `connect` event.
|
||||
|
||||
The difference is that if `connect()` is just called on the manager, then any sockets for that manager that are not the default
|
||||
socket will not automatically connect. `connect()` will need to be called individually for each socket. However, if `connect()`
|
||||
is called on a client, then in addition to opening the connection if needed, the client will connect to the its namespace,
|
||||
is called on a client, then in addition to opening the connection if needed, the client will connect to its namespace,
|
||||
and a `connect` event fired.
|
||||
|
||||
+5
-2
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -270,7 +273,7 @@ will fire a <code>connect</code> event. </p>
|
||||
|
||||
<p>The difference is that if <code>connect()</code> is just called on the manager, then any sockets for that manager that are not the default
|
||||
socket will not automatically connect. <code>connect()</code> will need to be called individually for each socket. However, if <code>connect()</code>
|
||||
is called on a client, then in addition to opening the connection if needed, the client will connect to the its namespace,
|
||||
is called on a client, then in addition to opening the connection if needed, the client will connect to its namespace,
|
||||
and a <code>connect</code> event fired.</p>
|
||||
|
||||
</div>
|
||||
@@ -280,7 +283,7 @@ and a <code>connect</code> event fired.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+4
-1
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -521,7 +524,7 @@ or call one of the <code>disconnectSocket</code> methods on this class.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -278,7 +281,7 @@ Example:</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -294,9 +297,9 @@ validation</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO11SSLSecurityCACSay10Starscream7SSLCertCG5certs_Sb13usePublicKeystcfc"></a>
|
||||
<a name="/s:8SocketIO11SSLSecurityC5certs13usePublicKeysACSay10Starscream7SSLCertCG_Sbtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(certs:usePublicKeys:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO11SSLSecurityCACSay10Starscream7SSLCertCG5certs_Sb13usePublicKeystcfc">init(certs:usePublicKeys:)</a>
|
||||
<a class="token" href="#/s:8SocketIO11SSLSecurityC5certs13usePublicKeysACSay10Starscream7SSLCertCG_Sbtcfc">init(certs:usePublicKeys:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -357,9 +360,9 @@ validation</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO11SSLSecurityC7isValidSbSo8SecTrustC_SSSg6domaintF"></a>
|
||||
<a name="/s:8SocketIO11SSLSecurityC7isValid_6domainSbSo11SecTrustRefa_SSSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/isValid(_:domain:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO11SSLSecurityC7isValidSbSo8SecTrustC_SSSg6domaintF">isValid(_:domain:)</a>
|
||||
<a class="token" href="#/s:8SocketIO11SSLSecurityC7isValid_6domainSbSo11SecTrustRefa_SSSgtF">isValid(_:domain:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -424,7 +427,7 @@ validation</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -285,9 +288,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A10AckEmitterCAcA0A8IOClientC6socket_Si6ackNumtcfc"></a>
|
||||
<a name="/s:8SocketIO0A10AckEmitterC6socket6ackNumAcA0A8IOClientC_Sitcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(socket:ackNum:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A10AckEmitterCAcA0A8IOClientC6socket_Si6ackNumtcfc">init(socket:ackNum:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A10AckEmitterC6socket6ackNumAcA0A8IOClientC_Sitcfc">init(socket:ackNum:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -354,9 +357,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A10AckEmitterC4withyAA0A4Data_pd_tF"></a>
|
||||
<a name="/s:8SocketIO0A10AckEmitterC4withyyAA0A4Data_pd_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/with(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A10AckEmitterC4withyAA0A4Data_pd_tF">with(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A10AckEmitterC4withyyAA0A4Data_pd_tF">with(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -366,7 +369,7 @@
|
||||
<div class="abstract">
|
||||
<p>Call to ack receiving this event.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[ackNum, items, theError]</code></p>
|
||||
|
||||
</div>
|
||||
@@ -454,7 +457,7 @@ will be emitted. The structure of the error data is <code>[ackNum, items, theErr
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -294,7 +297,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -290,9 +293,9 @@ See <code><a href="../Protocols/SocketEnginePollable.html">SocketEnginePollable<
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6EngineC8postWaitSaySSGvp"></a>
|
||||
<a name="/s:8SocketIO0A6EngineC8postWaitSaySS3msg_yycSg10completiontGvp"></a>
|
||||
<a name="//apple_ref/swift/Property/postWait" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC8postWaitSaySSGvp">postWait</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC8postWaitSaySS3msg_yycSg10completiontGvp">postWait</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -309,7 +312,7 @@ See <code><a href="../Protocols/SocketEnginePollable.html">SocketEnginePollable<
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">postWait</span> <span class="o">=</span> <span class="p">[</span><span class="kt">String</span><span class="p">]()</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">postWait</span> <span class="o">=</span> <span class="p">[</span><span class="kt"><a href="../Typealiases.html#/s:8SocketIO4Posta">Post</a></span><span class="p">]()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -651,9 +654,9 @@ disconnect us.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6EngineC7sessionSo10URLSessionCSgvp"></a>
|
||||
<a name="/s:8SocketIO0A6EngineC7sessionSo12NSURLSessionCSgvp"></a>
|
||||
<a name="//apple_ref/swift/Property/session" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC7sessionSo10URLSessionCSgvp">session</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC7sessionSo12NSURLSessionCSgvp">session</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -878,9 +881,9 @@ disconnect us.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6EngineCAcA0aC6Client_p6client_10Foundation3URLV3urlAA0A21IOClientConfigurationV6configtcfc"></a>
|
||||
<a name="/s:8SocketIO0A6EngineC6client3url6configAcA0aC6Client_p_10Foundation3URLVAA0A21IOClientConfigurationVtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(client:url:config:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineCAcA0aC6Client_p6client_10Foundation3URLV3urlAA0A21IOClientConfigurationV6configtcfc">init(client:url:config:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC6client3url6configAcA0aC6Client_p_10Foundation3URLVAA0A21IOClientConfigurationVtcfc">init(client:url:config:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1281,9 +1284,9 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6EngineC10setConfigsyAA0A21IOClientConfigurationVF"></a>
|
||||
<a name="/s:8SocketIO0A6EngineC10setConfigsyyAA0A21IOClientConfigurationVF"></a>
|
||||
<a name="//apple_ref/swift/Method/setConfigs(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC10setConfigsyAA0A21IOClientConfigurationVF">setConfigs(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC10setConfigsyyAA0A21IOClientConfigurationVF">setConfigs(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1310,9 +1313,9 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@M@SocketIO@objc(cs)SocketEngine(im)write:withType:withData:"></a>
|
||||
<a name="//apple_ref/swift/Method/write(_:withType:withData:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(cs)SocketEngine(im)write:withType:withData:">write(_:withType:withData:)</a>
|
||||
<a name="/c:@M@SocketIO@objc(cs)SocketEngine(im)write:withType:withData:completion:"></a>
|
||||
<a name="//apple_ref/swift/Method/write(_:withType:withData:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(cs)SocketEngine(im)write:withType:withData:completion:">write(_:withType:withData:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1327,7 +1330,7 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">write</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> <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">data</span><span class="p">:</span> <span class="p">[</span><span class="kt">Data</span><span class="p">])</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">write</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> <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">data</span><span class="p">:</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">-></span> <span class="p">())?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1371,6 +1374,18 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Callback called on transport write completion.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1391,9 +1406,9 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6EngineC10URLSessionySoADC7session_So7NSErrorCSg25didBecomeInvalidWithErrortF"></a>
|
||||
<a name="/s:8SocketIO0A6EngineC10URLSession7session25didBecomeInvalidWithErrorySo12NSURLSessionC_So7NSErrorCSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/URLSession(session:didBecomeInvalidWithError:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC10URLSessionySoADC7session_So7NSErrorCSg25didBecomeInvalidWithErrortF">URLSession(session:didBecomeInvalidWithError:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6EngineC10URLSession7session25didBecomeInvalidWithErrorySo12NSURLSessionC_So7NSErrorCSgtF">URLSession(session:didBecomeInvalidWithError:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1423,7 +1438,7 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -586,9 +589,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC10didConnectySS11toNamespace_tF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC10didConnect11toNamespaceySS_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/didConnect(toNamespace:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC10didConnectySS11toNamespace_tF">didConnect(toNamespace:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC10didConnect11toNamespaceySS_tF">didConnect(toNamespace:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -633,9 +636,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC13didDisconnectySS6reason_tF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC13didDisconnect6reasonySS_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/didDisconnect(reason:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC13didDisconnectySS6reason_tF">didDisconnect(reason:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC13didDisconnect6reasonySS_tF">didDisconnect(reason:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -709,9 +712,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC4emitySS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emit(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC4emitySS_AA0A4Data_pdtF">emit(_:_:)</a>
|
||||
<a name="/s:8SocketIO0A8IOClientC4emit__10completionySS_AA0A4Data_pdyycSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emit(_:_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC4emit__10completionySS_AA0A4Data_pdyycSgtF">emit(_:_:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -719,9 +722,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Send an event to the server, with optional data items.</p>
|
||||
<p>Send an event to the server, with optional data items and optional write completion handler.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[eventName, items, theError]</code></p>
|
||||
|
||||
</div>
|
||||
@@ -729,7 +732,7 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">emit</span><span class="p">(</span><span class="n">_</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="kt"><a href="../Protocols/SocketData.html">SocketData</a></span><span class="o">...</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">emit</span><span class="p">(</span><span class="n">_</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="kt"><a href="../Protocols/SocketData.html">SocketData</a></span><span class="o">...</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="p">())?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -761,6 +764,18 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Callback called on transport write completion.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -828,9 +843,79 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC11emitWithAckAA02OnF8CallbackCSS_AA0A4Data_pdtF"></a>
|
||||
<a name="/c:@M@SocketIO@objc(cs)SocketIOClient(im)emit:with:completion:"></a>
|
||||
<a name="//apple_ref/swift/Method/emit(_:with:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(cs)SocketIOClient(im)emit:with:completion:">emit(_:with:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Same as emit, but meant for Objective-C</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">emit</span><span class="p">(</span><span class="n">_</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">with</span> <span class="nv">items</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">],</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></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>event</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The event to send.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>items</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The items to send with this event. Send an empty array to send no data.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Callback called on transport write completion.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC11emitWithAckyAA02OnF8CallbackCSS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitWithAck(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC11emitWithAckAA02OnF8CallbackCSS_AA0A4Data_pdtF">emitWithAck(_:_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC11emitWithAckyAA02OnF8CallbackCSS_AA0A4Data_pdtF">emitWithAck(_:_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -843,7 +928,7 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<p><strong>NOTE</strong>: 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.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[eventName, items, theError]</code></p>
|
||||
|
||||
<p>Example:</p>
|
||||
@@ -973,9 +1058,9 @@ Check that your server’s api will ack the event being sent.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC7emitAckySi_SayypG4withtF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC7emitAck_4withySi_SayypGtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitAck(_:with:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC7emitAckySi_SayypG4withtF">emitAck(_:with:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC7emitAck_4withySi_SayypGtF">emitAck(_:with:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1091,9 +1176,9 @@ Check that your server’s api will ack the event being sent.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC17handleClientEventyAA0aeF0O_SayypG4datatF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC17handleClientEvent_4datayAA0aeF0O_SayypGtF"></a>
|
||||
<a name="//apple_ref/swift/Method/handleClientEvent(_:data:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC17handleClientEventyAA0aeF0O_SayypG4datatF">handleClientEvent(_:data:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC17handleClientEvent_4datayAA0aeF0O_SayypGtF">handleClientEvent(_:data:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1231,9 +1316,9 @@ Check that your server’s api will ack the event being sent.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC12handlePacketyAA0aE0VF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC12handlePacketyyAA0aE0VF"></a>
|
||||
<a name="//apple_ref/swift/Method/handlePacket(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC12handlePacketyAA0aE0VF">handlePacket(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC12handlePacketyyAA0aE0VF">handlePacket(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1332,9 +1417,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC3offyAA0A11ClientEventO06clientF0_tF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC3off11clientEventyAA0a6ClientF0O_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/off(clientEvent:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC3offyAA0A11ClientEventO06clientF0_tF">off(clientEvent:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC3off11clientEventyAA0a6ClientF0O_tF">off(clientEvent:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1538,9 +1623,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC2on10Foundation4UUIDVAA0A11ClientEventO06clientH0_ySayypG_AA0A10AckEmitterCtc8callbacktF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC2on11clientEvent8callback10Foundation4UUIDVAA0a6ClientF0O_ySayypG_AA0A10AckEmitterCtctF"></a>
|
||||
<a name="//apple_ref/swift/Method/on(clientEvent:callback:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC2on10Foundation4UUIDVAA0A11ClientEventO06clientH0_ySayypG_AA0A10AckEmitterCtc8callbacktF">on(clientEvent:callback:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC2on11clientEvent8callback10Foundation4UUIDVAA0a6ClientF0O_ySayypG_AA0A10AckEmitterCtctF">on(clientEvent:callback:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1606,9 +1691,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8IOClientC4once10Foundation4UUIDVAA0A11ClientEventO06clientH0_ySayypG_AA0A10AckEmitterCtc8callbacktF"></a>
|
||||
<a name="/s:8SocketIO0A8IOClientC4once11clientEvent8callback10Foundation4UUIDVAA0a6ClientF0O_ySayypG_AA0A10AckEmitterCtctF"></a>
|
||||
<a name="//apple_ref/swift/Method/once(clientEvent:callback:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC4once10Foundation4UUIDVAA0A11ClientEventO06clientH0_ySayypG_AA0A10AckEmitterCtc8callbacktF">once(clientEvent:callback:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8IOClientC4once11clientEvent8callback10Foundation4UUIDVAA0a6ClientF0O_ySayypG_AA0A10AckEmitterCtctF">once(clientEvent:callback:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1857,7 +1942,7 @@ Called when the manager detects a broken connection, or when a manual reconnect
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -547,9 +550,9 @@ So this should ideally be an array of one packet waiting for data.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A7ManagerCAC10Foundation3URLV06socketE0_AA0A21IOClientConfigurationV6configtcfc"></a>
|
||||
<a name="/s:8SocketIO0A7ManagerC9socketURL6configAC10Foundation0E0V_AA0A21IOClientConfigurationVtcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(socketURL:config:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerCAC10Foundation3URLV06socketE0_AA0A21IOClientConfigurationV6configtcfc">init(socketURL:config:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC9socketURL6configAC10Foundation0E0V_AA0A21IOClientConfigurationVtcfc">init(socketURL:config:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -921,9 +924,9 @@ releasing.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A7ManagerC7emitAllyAA0A11ClientEventO06clientG0_SayypG4datatF"></a>
|
||||
<a name="/s:8SocketIO0A7ManagerC7emitAll11clientEvent4datayAA0a6ClientG0O_SayypGtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitAll(clientEvent:data:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC7emitAllyAA0A11ClientEventO06clientG0_SayypG4datatF">emitAll(clientEvent:data:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC7emitAll11clientEvent4datayAA0a6ClientG0O_SayypGtF">emitAll(clientEvent:data:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -967,9 +970,9 @@ releasing.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A7ManagerC7emitAllySS_AA0A4Data_pdtF"></a>
|
||||
<a name="/s:8SocketIO0A7ManagerC7emitAllyySS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitAll(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC7emitAllySS_AA0A4Data_pdtF">emitAll(_:_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC7emitAllyySS_AA0A4Data_pdtF">emitAll(_:_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1037,7 +1040,7 @@ releasing.</p>
|
||||
<div class="abstract">
|
||||
<p>Sends an event to the server on all namespaces in this manager.</p>
|
||||
|
||||
<p>Same as <code><a href="../Classes/SocketManager.html#/s:8SocketIO0A7ManagerC7emitAllySS_AA0A4Data_pdtF">emitAll(_:_:)</a></code>, but meant for Objective-C.</p>
|
||||
<p>Same as <code><a href="../Classes/SocketManager.html#/s:8SocketIO0A7ManagerC7emitAllyySS_AA0A4Data_pdtF">emitAll(_:_:)</a></code>, but meant for Objective-C.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -1274,6 +1277,52 @@ releasing.</p>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@M@SocketIO@objc(cs)SocketManager(im)engineDidWebsocketUpgradeWithHeaders:"></a>
|
||||
<a name="//apple_ref/swift/Method/engineDidWebsocketUpgrade(headers:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(cs)SocketManager(im)engineDidWebsocketUpgradeWithHeaders:">engineDidWebsocketUpgrade(headers:)</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 when upgrading the http connection to a websocket connection.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">engineDidWebsocketUpgrade</span><span class="p">(</span><span class="nv">headers</span><span class="p">:</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>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>headers</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The http headers.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
@@ -1381,8 +1430,8 @@ releasing.</p>
|
||||
<div class="abstract">
|
||||
<p>Tries to reconnect to the server.</p>
|
||||
|
||||
<p>This will cause a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO9reconnectA2CmF">SocketClientEvent.reconnect</a></code> event to be emitted, as well as
|
||||
<code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO16reconnectAttemptA2CmF">SocketClientEvent.reconnectAttempt</a></code> events.</p>
|
||||
<p>This will cause a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO9reconnectyA2CmF">SocketClientEvent.reconnect</a></code> event to be emitted, as well as
|
||||
<code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO16reconnectAttemptyA2CmF">SocketClientEvent.reconnectAttempt</a></code> events.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -1452,9 +1501,9 @@ method.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A7ManagerC10setConfigsyAA0A21IOClientConfigurationVF"></a>
|
||||
<a name="/s:8SocketIO0A7ManagerC10setConfigsyyAA0A21IOClientConfigurationVF"></a>
|
||||
<a name="//apple_ref/swift/Method/setConfigs(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC10setConfigsyAA0A21IOClientConfigurationVF">setConfigs(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A7ManagerC10setConfigsyyAA0A21IOClientConfigurationVF">setConfigs(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1542,7 +1591,7 @@ Or call <code><a href="../Classes/SocketIOClient.html#/c:@M@SocketIO@objc(cs)Soc
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -205,9 +208,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A10RawAckViewC4withyAA0A4Data_pd_tF"></a>
|
||||
<a name="/s:8SocketIO0A10RawAckViewC4withyyAA0A4Data_pd_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/with(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A10RawAckViewC4withyAA0A4Data_pd_tF">with(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A10RawAckViewC4withyyAA0A4Data_pd_tF">with(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -217,7 +220,7 @@
|
||||
<div class="abstract">
|
||||
<p>Call to ack receiving this event.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[ackNum, items, theError]</code></p>
|
||||
|
||||
</div>
|
||||
@@ -305,7 +308,7 @@ will be emitted. The structure of the error data is <code>[ackNum, items, theErr
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -205,9 +208,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A7RawViewC4emitySS_AA0A4Data_pdtF"></a>
|
||||
<a name="/s:8SocketIO0A7RawViewC4emityySS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emit(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A7RawViewC4emitySS_AA0A4Data_pdtF">emit(_:_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A7RawViewC4emityySS_AA0A4Data_pdtF">emit(_:_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -217,7 +220,7 @@
|
||||
<div class="abstract">
|
||||
<p>Send an event to the server, with optional data items.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[eventName, items, theError]</code></p>
|
||||
|
||||
</div>
|
||||
@@ -324,9 +327,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A7RawViewC11emitWithAckAA02OnG8CallbackCSS_AA0A4Data_pdtF"></a>
|
||||
<a name="/s:8SocketIO0A7RawViewC11emitWithAckyAA02OnG8CallbackCSS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitWithAck(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A7RawViewC11emitWithAckAA02OnG8CallbackCSS_AA0A4Data_pdtF">emitWithAck(_:_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A7RawViewC11emitWithAckyAA02OnG8CallbackCSS_AA0A4Data_pdtF">emitWithAck(_:_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -339,7 +342,7 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<p><strong>NOTE</strong>: 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.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[eventName, items, theError]</code></p>
|
||||
|
||||
<p>Example:</p>
|
||||
@@ -474,7 +477,7 @@ Check that your server’s api will ack the event being sent.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+4
-1
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -387,7 +390,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -201,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A9AckStatusO02noC0A2CmF"></a>
|
||||
<a name="/s:8SocketIO0A9AckStatusO02noC0yA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/noAck" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A9AckStatusO02noC0A2CmF">noAck</a>
|
||||
<a class="token" href="#/s:8SocketIO0A9AckStatusO02noC0yA2CmF">noAck</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -233,7 +236,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -201,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO7connectA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO7connectyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/connect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO7connectA2CmF">connect</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO7connectyA2CmF">connect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -238,9 +241,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO10disconnectA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO10disconnectyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/disconnect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO10disconnectA2CmF">disconnect</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO10disconnectyA2CmF">disconnect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -275,9 +278,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO5errorA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO5erroryA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO5errorA2CmF">error</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO5erroryA2CmF">error</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -312,9 +315,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO4pingA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO4pingyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/ping" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO4pingA2CmF">ping</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO4pingyA2CmF">ping</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -349,9 +352,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO4pongA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO4pongyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/pong" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO4pongA2CmF">pong</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO4pongyA2CmF">pong</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -386,9 +389,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO9reconnectA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO9reconnectyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO9reconnectA2CmF">reconnect</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO9reconnectyA2CmF">reconnect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -423,9 +426,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO16reconnectAttemptA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO16reconnectAttemptyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnectAttempt" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO16reconnectAttemptA2CmF">reconnectAttempt</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO16reconnectAttemptyA2CmF">reconnectAttempt</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -460,9 +463,9 @@ data item: the namespace that was connected to.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO12statusChangeA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A11ClientEventO12statusChangeyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/statusChange" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO12statusChangeA2CmF">statusChange</a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO12statusChangeyA2CmF">statusChange</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -492,13 +495,51 @@ data item: the namespace that was connected to.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul class="item-container">
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A11ClientEventO16websocketUpgradeyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/websocketUpgrade" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A11ClientEventO16websocketUpgradeyA2CmF">websocketUpgrade</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Emitted when when upgrading the http connection to a websocket connection.</p>
|
||||
|
||||
<p>Usage:</p>
|
||||
<pre class="highlight swift"><code><span class="n">socket</span><span class="o">.</span><span class="nf">on</span><span class="p">(</span><span class="nv">clientEvent</span><span class="p">:</span> <span class="o">.</span><span class="n">websocketUpgrade</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">let</span> <span class="nv">headers</span> <span class="o">=</span> <span class="p">(</span><span class="n">data</span> <span class="k">as</span> <span class="p">[</span><span class="kt">Any</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="c1">// Some header logic</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">websocketUpgrade</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -419,7 +422,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -201,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO8compressA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO8compressyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/compress" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO8compressA2CmF">compress</a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO8compressyA2CmF">compress</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -232,9 +235,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO13connectParamsACs10DictionaryVySSypGcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/connectParams" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO13connectParamsACs10DictionaryVySSypGcACmF">connectParams</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO13connectParamsyACSDySSypGcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/connectParams(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO13connectParamsyACSDySSypGcACmF">connectParams(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -263,9 +266,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO7cookiesACSaySo10HTTPCookieCGcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/cookies" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO7cookiesACSaySo10HTTPCookieCGcACmF">cookies</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO7cookiesyACSaySo12NSHTTPCookieCGcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/cookies(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO7cookiesyACSaySo12NSHTTPCookieCGcACmF">cookies(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -294,9 +297,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO12extraHeadersACs10DictionaryVyS2SGcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/extraHeaders" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO12extraHeadersACs10DictionaryVyS2SGcACmF">extraHeaders</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO12extraHeadersyACSDyS2SGcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/extraHeaders(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO12extraHeadersyACSDyS2SGcACmF">extraHeaders(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -325,9 +328,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO8forceNewACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/forceNew" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO8forceNewACSbcACmF">forceNew</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO8forceNewyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/forceNew(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO8forceNewyACSbcACmF">forceNew(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -357,9 +360,9 @@ or when you want to be sure no state from previous engines is being carried over
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO12forcePollingACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/forcePolling" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO12forcePollingACSbcACmF">forcePolling</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO12forcePollingyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/forcePolling(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO12forcePollingyACSbcACmF">forcePolling(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -388,9 +391,9 @@ or when you want to be sure no state from previous engines is being carried over
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO15forceWebsocketsACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/forceWebsockets" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO15forceWebsocketsACSbcACmF">forceWebsockets</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO15forceWebsocketsyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/forceWebsockets(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO15forceWebsocketsyACSbcACmF">forceWebsockets(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -419,9 +422,9 @@ or when you want to be sure no state from previous engines is being carried over
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO11handleQueueACSo08DispatchF0CcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/handleQueue" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO11handleQueueACSo08DispatchF0CcACmF">handleQueue</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO11handleQueueyACSo17OS_dispatch_queueCcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/handleQueue(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO11handleQueueyACSo17OS_dispatch_queueCcACmF">handleQueue(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -453,9 +456,9 @@ called on.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO3logACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/log" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO3logACSbcACmF">log</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO3logyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/log(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO3logyACSbcACmF">log(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -484,9 +487,9 @@ called on.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO6loggerAcA0A6Logger_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/logger" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO6loggerAcA0A6Logger_pcACmF">logger</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO6loggeryAcA0A6Logger_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/logger(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO6loggeryAcA0A6Logger_pcACmF">logger(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -515,9 +518,9 @@ called on.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO4pathACSScACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/path" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO4pathACSScACmF">path</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO4pathyACSScACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/path(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO4pathyACSScACmF">path(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -546,9 +549,9 @@ called on.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO10reconnectsACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnects" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO10reconnectsACSbcACmF">reconnects</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO10reconnectsyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnects(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO10reconnectsyACSbcACmF">reconnects(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -578,9 +581,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO17reconnectAttemptsACSicACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnectAttempts" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO17reconnectAttemptsACSicACmF">reconnectAttempts</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO17reconnectAttemptsyACSicACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnectAttempts(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO17reconnectAttemptsyACSicACmF">reconnectAttempts(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -609,9 +612,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO13reconnectWaitACSicACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnectWait" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO13reconnectWaitACSicACmF">reconnectWait</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO13reconnectWaityACSicACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/reconnectWait(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO13reconnectWaityACSicACmF">reconnectWait(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -640,9 +643,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO6secureACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/secure" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO6secureACSbcACmF">secure</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO6secureyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/secure(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO6secureyACSbcACmF">secure(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -671,9 +674,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO8securityAcA11SSLSecurityCcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/security" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO8securityAcA11SSLSecurityCcACmF">security</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO8securityyAcA11SSLSecurityCcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/security(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO8securityyAcA11SSLSecurityCcACmF">security(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -702,9 +705,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO10selfSignedACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/selfSigned" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO10selfSignedACSbcACmF">selfSigned</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO10selfSignedyACSbcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/selfSigned(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO10selfSignedyACSbcACmF">selfSigned(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -733,9 +736,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO15sessionDelegateACSo010URLSessionF0_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/sessionDelegate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO15sessionDelegateACSo010URLSessionF0_pcACmF">sessionDelegate</a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO15sessionDelegateyACSo012NSURLSessionF0_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/sessionDelegate(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO15sessionDelegateyACSo012NSURLSessionF0_pcACmF">sessionDelegate(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -809,9 +812,9 @@ over when reconnects happen.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO2eeoiSbAC_ACtFZ"></a>
|
||||
<a name="/s:8SocketIO0A14IOClientOptionO2eeoiySbAC_ACtFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO2eeoiSbAC_ACtFZ">==(_:_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A14IOClientOptionO2eeoiySbAC_ACtFZ">==(_:_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -876,7 +879,7 @@ over when reconnects happen.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -393,7 +396,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -201,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A13ParsableErrorO16invalidDataArrayA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A13ParsableErrorO16invalidDataArrayyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidDataArray" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A13ParsableErrorO16invalidDataArrayA2CmF">invalidDataArray</a>
|
||||
<a class="token" href="#/s:8SocketIO0A13ParsableErrorO16invalidDataArrayyA2CmF">invalidDataArray</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -232,9 +235,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A13ParsableErrorO13invalidPacketA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A13ParsableErrorO13invalidPacketyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidPacket" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A13ParsableErrorO13invalidPacketA2CmF">invalidPacket</a>
|
||||
<a class="token" href="#/s:8SocketIO0A13ParsableErrorO13invalidPacketyA2CmF">invalidPacket</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -263,9 +266,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A13ParsableErrorO17invalidPacketTypeA2CmF"></a>
|
||||
<a name="/s:8SocketIO0A13ParsableErrorO17invalidPacketTypeyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/invalidPacketType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A13ParsableErrorO17invalidPacketTypeA2CmF">invalidPacketType</a>
|
||||
<a class="token" href="#/s:8SocketIO0A13ParsableErrorO17invalidPacketTypeyA2CmF">invalidPacketType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -295,7 +298,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+4
-1
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -195,7 +198,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+9
-6
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -340,7 +343,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketIOClientSpec</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketIOClientSpec</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -449,7 +452,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><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>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketLogger</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -481,7 +484,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketParsable</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketParsable</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -509,7 +512,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketDataBufferable</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketDataBufferable</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -557,7 +560,7 @@ or call one of the <code>disconnectSocket</code> methods on this class.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketManagerSpec</span> <span class="p">:</span> <span class="kd">class</span><span class="p">,</span> <span class="kt"><a href="Protocols/SocketEngineClient.html">SocketEngineClient</a></span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketManagerSpec</span> <span class="p">:</span> <span class="kt">AnyObject</span><span class="p">,</span> <span class="kt"><a href="Protocols/SocketEngineClient.html">SocketEngineClient</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -572,7 +575,7 @@ or call one of the <code>disconnectSocket</code> methods on this class.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -208,9 +211,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO14ConfigSettableP10setConfigsyAA0A21IOClientConfigurationVF"></a>
|
||||
<a name="/s:8SocketIO14ConfigSettableP10setConfigsyyAA0A21IOClientConfigurationVF"></a>
|
||||
<a name="//apple_ref/swift/Method/setConfigs(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO14ConfigSettableP10setConfigsyAA0A21IOClientConfigurationVF">setConfigs(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO14ConfigSettableP10setConfigsyyAA0A21IOClientConfigurationVF">setConfigs(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -259,7 +262,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -261,7 +264,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -185,7 +188,7 @@
|
||||
<h1>SocketDataBufferable</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketDataBufferable</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketDataBufferable</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -245,7 +248,7 @@ So this should ideally be an array of one packet waiting for data.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -489,6 +492,52 @@
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@M@SocketIO@objc(pl)SocketEngineClient(im)engineDidWebsocketUpgradeWithHeaders:"></a>
|
||||
<a name="//apple_ref/swift/Method/engineDidWebsocketUpgrade(headers:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(pl)SocketEngineClient(im)engineDidWebsocketUpgradeWithHeaders:">engineDidWebsocketUpgrade(headers:)</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 when upgrading the http connection to a websocket connection.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">engineDidWebsocketUpgrade</span><span class="p">(</span><span class="nv">headers</span><span class="p">:</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>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>headers</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The http headers.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -497,7 +546,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -235,9 +238,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14EnginePollableP8postWaitSaySSGvp"></a>
|
||||
<a name="/s:8SocketIO0A14EnginePollableP8postWaitSaySS3msg_yycSg10completiontGvp"></a>
|
||||
<a name="//apple_ref/swift/Property/postWait" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14EnginePollableP8postWaitSaySSGvp">postWait</a>
|
||||
<a class="token" href="#/s:8SocketIO0A14EnginePollableP8postWaitSaySS3msg_yycSg10completiontGvp">postWait</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -254,7 +257,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><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>
|
||||
<pre class="highlight swift"><code><span class="k">var</span> <span class="nv">postWait</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Typealiases.html#/s:8SocketIO4Posta">Post</a></span><span class="p">]</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -264,9 +267,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14EnginePollableP7sessionSo10URLSessionCSgvp"></a>
|
||||
<a name="/s:8SocketIO0A14EnginePollableP7sessionSo12NSURLSessionCSgvp"></a>
|
||||
<a name="//apple_ref/swift/Property/session" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14EnginePollableP7sessionSo10URLSessionCSgvp">session</a>
|
||||
<a class="token" href="#/s:8SocketIO0A14EnginePollableP7sessionSo12NSURLSessionCSgvp">session</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -401,9 +404,9 @@ disconnect us.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A14EnginePollableP15sendPollMessageySS_AA0aC10PacketTypeO04withI0Say10Foundation4DataVG0jL0tF"></a>
|
||||
<a name="//apple_ref/swift/Method/sendPollMessage(_:withType:withData:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14EnginePollableP15sendPollMessageySS_AA0aC10PacketTypeO04withI0Say10Foundation4DataVG0jL0tF">sendPollMessage(_:withType:withData:)</a>
|
||||
<a name="/s:8SocketIO0A14EnginePollableP15sendPollMessage_8withType0H4Data10completionySS_AA0ac6PacketI0OSay10Foundation0J0VGyycSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/sendPollMessage(_:withType:withData:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A14EnginePollableP15sendPollMessage_8withType0H4Data10completionySS_AA0ac6PacketI0OSay10Foundation0J0VGyycSgtF">sendPollMessage(_:withType:withData:completion:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -430,7 +433,7 @@ disconnect us.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><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>
|
||||
<pre class="highlight swift"><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> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="p">())?)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -523,7 +526,7 @@ disconnect us.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -1065,9 +1068,9 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@M@SocketIO@objc(pl)SocketEngineSpec(im)write:withType:withData:"></a>
|
||||
<a name="//apple_ref/swift/Method/write(_:withType:withData:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(pl)SocketEngineSpec(im)write:withType:withData:">write(_:withType:withData:)</a>
|
||||
<a name="/c:@M@SocketIO@objc(pl)SocketEngineSpec(im)write:withType:withData:completion:"></a>
|
||||
<a name="//apple_ref/swift/Method/write(_:withType:withData:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@M@SocketIO@objc(pl)SocketEngineSpec(im)write:withType:withData:completion:">write(_:withType:withData:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1082,7 +1085,7 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">write</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> <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">data</span><span class="p">:</span> <span class="p">[</span><span class="kt">Data</span><span class="p">])</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">write</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> <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">data</span><span class="p">:</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">-></span> <span class="p">())?)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1126,6 +1129,18 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Callback called on transport write completion.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1140,7 +1155,7 @@ the engine is attempting to upgrade to WebSocket it does not do any POSTing.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -208,9 +211,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A15EngineWebsocketP07sendWebA7MessageySS_AA0aC10PacketTypeO04withI0Say10Foundation4DataVG0jL0tF"></a>
|
||||
<a name="//apple_ref/swift/Method/sendWebSocketMessage(_:withType:withData:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A15EngineWebsocketP07sendWebA7MessageySS_AA0aC10PacketTypeO04withI0Say10Foundation4DataVG0jL0tF">sendWebSocketMessage(_:withType:withData:)</a>
|
||||
<a name="/s:8SocketIO0A15EngineWebsocketP07sendWebA7Message_8withType0H4Data10completionySS_AA0ac6PacketI0OSay10Foundation0J0VGyycSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/sendWebSocketMessage(_:withType:withData:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A15EngineWebsocketP07sendWebA7Message_8withType0H4Data10completionySS_AA0ac6PacketI0OSay10Foundation0J0VGyycSgtF">sendWebSocketMessage(_:withType:withData:completion:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -237,7 +240,7 @@
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><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>
|
||||
<pre class="highlight swift"><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></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -281,6 +284,18 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Callback called on transport write completion.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -295,7 +310,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -185,7 +188,7 @@
|
||||
<h1>SocketIOClientSpec</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketIOClientSpec</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketIOClientSpec</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -399,7 +402,7 @@
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Connect to the server. The same as calling <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP7connectySd12timeoutAfter_yycSg11withHandlertF">connect(timeoutAfter:withHandler:)</a></code> with a timeout of 0.</p>
|
||||
<p>Connect to the server. The same as calling <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP7connect12timeoutAfter11withHandlerySd_yycSgtF">connect(timeoutAfter:withHandler:)</a></code> with a timeout of 0.</p>
|
||||
|
||||
<p>Only call after adding your event listeners, unless you know what you’re doing.</p>
|
||||
|
||||
@@ -418,9 +421,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP7connectySd12timeoutAfter_yycSg11withHandlertF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP7connect12timeoutAfter11withHandlerySd_yycSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/connect(timeoutAfter:withHandler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP7connectySd12timeoutAfter_yycSg11withHandlertF">connect(timeoutAfter:withHandler:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP7connect12timeoutAfter11withHandlerySd_yycSgtF">connect(timeoutAfter:withHandler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -479,9 +482,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP10didConnectySS11toNamespace_tF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP10didConnect11toNamespaceySS_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/didConnect(toNamespace:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP10didConnectySS11toNamespace_tF">didConnect(toNamespace:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP10didConnect11toNamespaceySS_tF">didConnect(toNamespace:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -526,9 +529,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP13didDisconnectySS6reason_tF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP13didDisconnect6reasonySS_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/didDisconnect(reason:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP13didDisconnectySS6reason_tF">didDisconnect(reason:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP13didDisconnect6reasonySS_tF">didDisconnect(reason:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -572,9 +575,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP8didErrorySS6reason_tF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP8didError6reasonySS_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/didError(reason:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP8didErrorySS6reason_tF">didError(reason:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP8didError6reasonySS_tF">didError(reason:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -653,9 +656,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP4emitySS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emit(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP4emitySS_AA0A4Data_pdtF">emit(_:_:)</a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP4emit__10completionySS_AA0A4Data_pdyycSgtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emit(_:_:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP4emit__10completionySS_AA0A4Data_pdyycSgtF">emit(_:_:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -663,9 +666,9 @@ then this is only called when the client connects to that namespace.</p>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Send an event to the server, with optional data items.</p>
|
||||
<p>Send an event to the server, with optional data items and optional write completion handler.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[eventName, items, theError]</code></p>
|
||||
|
||||
</div>
|
||||
@@ -673,7 +676,7 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">emit</span><span class="p">(</span><span class="n">_</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="kt"><a href="../Protocols/SocketData.html">SocketData</a></span><span class="o">...</span><span class="p">)</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">emit</span><span class="p">(</span><span class="n">_</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">_</span> <span class="nv">items</span><span class="p">:</span> <span class="kt"><a href="../Protocols/SocketData.html">SocketData</a></span><span class="o">...</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">(()</span> <span class="o">-></span> <span class="p">())?)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -705,6 +708,18 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Callback called on transport write completion.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -714,9 +729,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP7emitAckySi_SayypG4withtF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP7emitAck_4withySi_SayypGtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitAck(_:with:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP7emitAckySi_SayypG4withtF">emitAck(_:with:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP7emitAck_4withySi_SayypGtF">emitAck(_:with:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -772,9 +787,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP11emitWithAckAA02OnG8CallbackCSS_AA0A4Data_pdtF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP11emitWithAckyAA02OnG8CallbackCSS_AA0A4Data_pdtF"></a>
|
||||
<a name="//apple_ref/swift/Method/emitWithAck(_:_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP11emitWithAckAA02OnG8CallbackCSS_AA0A4Data_pdtF">emitWithAck(_:_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP11emitWithAckyAA02OnG8CallbackCSS_AA0A4Data_pdtF">emitWithAck(_:_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -787,7 +802,7 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<p><strong>NOTE</strong>: 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.</p>
|
||||
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5errorA2CmF">SocketClientEvent.error</a></code>
|
||||
<p>If an error occurs trying to transform <code>items</code> into their socket representation, a <code><a href="../Enums/SocketClientEvent.html#/s:8SocketIO0A11ClientEventO5erroryA2CmF">SocketClientEvent.error</a></code>
|
||||
will be emitted. The structure of the error data is <code>[eventName, items, theError]</code></p>
|
||||
|
||||
<p>Example:</p>
|
||||
@@ -846,9 +861,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP9handleAckySi_SayypG4datatF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP9handleAck_4dataySi_SayypGtF"></a>
|
||||
<a name="//apple_ref/swift/Method/handleAck(_:data:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP9handleAckySi_SayypG4datatF">handleAck(_:data:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP9handleAck_4dataySi_SayypGtF">handleAck(_:data:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -904,9 +919,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP17handleClientEventyAA0afG0O_SayypG4datatF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP17handleClientEvent_4datayAA0afG0O_SayypGtF"></a>
|
||||
<a name="//apple_ref/swift/Method/handleClientEvent(_:data:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP17handleClientEventyAA0afG0O_SayypG4datatF">handleClientEvent(_:data:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP17handleClientEvent_4datayAA0afG0O_SayypGtF">handleClientEvent(_:data:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -962,9 +977,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP11handleEventySS_SayypG4dataSb17isInternalMessageSi7withAcktF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP11handleEvent_4data17isInternalMessage7withAckySS_SayypGSbSitF"></a>
|
||||
<a name="//apple_ref/swift/Method/handleEvent(_:data:isInternalMessage:withAck:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP11handleEventySS_SayypG4dataSb17isInternalMessageSi7withAcktF">handleEvent(_:data:isInternalMessage:withAck:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP11handleEvent_4data17isInternalMessage7withAckySS_SayypGSbSitF">handleEvent(_:data:isInternalMessage:withAck:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1044,9 +1059,9 @@ will be emitted. The structure of the error data is <code>[eventName, items, the
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP12handlePacketyAA0aF0VF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP12handlePacketyyAA0aF0VF"></a>
|
||||
<a name="//apple_ref/swift/Method/handlePacket(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP12handlePacketyAA0aF0VF">handlePacket(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP12handlePacketyyAA0aF0VF">handlePacket(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1145,9 +1160,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP3offyAA0A11ClientEventO06clientG0_tF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP3off11clientEventyAA0a6ClientG0O_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/off(clientEvent:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP3offyAA0A11ClientEventO06clientG0_tF">off(clientEvent:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP3off11clientEventyAA0a6ClientG0O_tF">off(clientEvent:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1157,7 +1172,7 @@ socket.</p>
|
||||
<div class="abstract">
|
||||
<p>Removes handler(s) for a client event.</p>
|
||||
|
||||
<p>If you wish to remove a client event handler, call the <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP3offy10Foundation4UUIDV2id_tF">off(id:)</a></code> with the UUID received from its <code>on</code> call.</p>
|
||||
<p>If you wish to remove a client event handler, call the <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP3off2idy10Foundation4UUIDV_tF">off(id:)</a></code> with the UUID received from its <code>on</code> call.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -1193,9 +1208,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP3offySSF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP3offyySSF"></a>
|
||||
<a name="//apple_ref/swift/Method/off(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP3offySSF">off(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP3offyySSF">off(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1205,7 +1220,7 @@ socket.</p>
|
||||
<div class="abstract">
|
||||
<p>Removes handler(s) based on an event name.</p>
|
||||
|
||||
<p>If you wish to remove a specific event, call the <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP3offy10Foundation4UUIDV2id_tF">off(id:)</a></code> with the UUID received from its <code>on</code> call.</p>
|
||||
<p>If you wish to remove a specific event, call the <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP3off2idy10Foundation4UUIDV_tF">off(id:)</a></code> with the UUID received from its <code>on</code> call.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -1241,9 +1256,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP3offy10Foundation4UUIDV2id_tF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP3off2idy10Foundation4UUIDV_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/off(id:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP3offy10Foundation4UUIDV2id_tF">off(id:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP3off2idy10Foundation4UUIDV_tF">off(id:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1253,7 +1268,7 @@ socket.</p>
|
||||
<div class="abstract">
|
||||
<p>Removes a handler with the specified UUID gotten from an <code>on</code> or <code>once</code></p>
|
||||
|
||||
<p>If you want to remove all events for an event, call the off <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP3offySSF">off(_:)</a></code> method with the event name.</p>
|
||||
<p>If you want to remove all events for an event, call the off <code><a href="../Protocols/SocketIOClientSpec.html#/s:8SocketIO0A12IOClientSpecP3offyySSF">off(_:)</a></code> method with the event name.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
@@ -1289,9 +1304,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP2on10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtc8callbacktF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP2on_8callback10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtctF"></a>
|
||||
<a name="//apple_ref/swift/Method/on(_:callback:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP2on10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtc8callbacktF">on(_:callback:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP2on_8callback10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtctF">on(_:callback:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1351,9 +1366,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP2on10Foundation4UUIDVAA0A11ClientEventO06clientI0_ySayypG_AA0A10AckEmitterCtc8callbacktF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP2on11clientEvent8callback10Foundation4UUIDVAA0a6ClientG0O_ySayypG_AA0A10AckEmitterCtctF"></a>
|
||||
<a name="//apple_ref/swift/Method/on(clientEvent:callback:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP2on10Foundation4UUIDVAA0A11ClientEventO06clientI0_ySayypG_AA0A10AckEmitterCtc8callbacktF">on(clientEvent:callback:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP2on11clientEvent8callback10Foundation4UUIDVAA0a6ClientG0O_ySayypG_AA0A10AckEmitterCtctF">on(clientEvent:callback:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1419,9 +1434,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP4once10Foundation4UUIDVAA0A11ClientEventO06clientI0_ySayypG_AA0A10AckEmitterCtc8callbacktF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP4once11clientEvent8callback10Foundation4UUIDVAA0a6ClientG0O_ySayypG_AA0A10AckEmitterCtctF"></a>
|
||||
<a name="//apple_ref/swift/Method/once(clientEvent:callback:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP4once10Foundation4UUIDVAA0A11ClientEventO06clientI0_ySayypG_AA0A10AckEmitterCtc8callbacktF">once(clientEvent:callback:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP4once11clientEvent8callback10Foundation4UUIDVAA0a6ClientG0O_ySayypG_AA0A10AckEmitterCtctF">once(clientEvent:callback:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1481,9 +1496,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP4once10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtc8callbacktF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP4once_8callback10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtctF"></a>
|
||||
<a name="//apple_ref/swift/Method/once(_:callback:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP4once10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtc8callbacktF">once(_:callback:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP4once_8callback10Foundation4UUIDVSS_ySayypG_AA0A10AckEmitterCtctF">once(_:callback:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1543,9 +1558,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP5onAnyyyAA0aF5EventCcF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP5onAnyyyyAA0aF5EventCcF"></a>
|
||||
<a name="//apple_ref/swift/Method/onAny(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP5onAnyyyAA0aF5EventCcF">onAny(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP5onAnyyyyAA0aF5EventCcF">onAny(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1618,9 +1633,9 @@ socket.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP15setReconnectingySS6reason_tF"></a>
|
||||
<a name="/s:8SocketIO0A12IOClientSpecP15setReconnecting6reasonySS_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/setReconnecting(reason:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP15setReconnectingySS6reason_tF">setReconnecting(reason:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12IOClientSpecP15setReconnecting6reasonySS_tF">setReconnecting(reason:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -1653,7 +1668,7 @@ Called when the manager detects a broken connection, or when a manual reconnect
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -185,7 +188,7 @@
|
||||
<h1>SocketLogger</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight swift"><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>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketLogger</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -246,9 +249,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6LoggerP3logySSyXK_SS4typetF"></a>
|
||||
<a name="/s:8SocketIO0A6LoggerP3log_4typeySSyXK_SStF"></a>
|
||||
<a name="//apple_ref/swift/Method/log(_:type:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6LoggerP3logySSyXK_SS4typetF">log(_:type:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6LoggerP3log_4typeySSyXK_SStF">log(_:type:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -324,9 +327,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6LoggerP5errorySSyXK_SS4typetF"></a>
|
||||
<a name="/s:8SocketIO0A6LoggerP5error_4typeySSyXK_SStF"></a>
|
||||
<a name="//apple_ref/swift/Method/error(_:type:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6LoggerP5errorySSyXK_SS4typetF">error(_:type:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6LoggerP5error_4typeySSyXK_SStF">error(_:type:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -407,7 +410,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -185,7 +188,7 @@
|
||||
<h1>SocketManagerSpec</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketManagerSpec</span> <span class="p">:</span> <span class="kd">class</span><span class="p">,</span> <span class="kt"><a href="../Protocols/SocketEngineClient.html">SocketEngineClient</a></span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketManagerSpec</span> <span class="p">:</span> <span class="kt">AnyObject</span><span class="p">,</span> <span class="kt"><a href="../Protocols/SocketEngineClient.html">SocketEngineClient</a></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -916,7 +919,7 @@ Or call <code><a href="../Classes/SocketIOClient.html#/c:@M@SocketIO@objc(cs)Soc
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -185,7 +188,7 @@
|
||||
<h1>SocketParsable</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketParsable</span> <span class="p">:</span> <span class="kd">class</span></code></pre>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">SocketParsable</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,9 +211,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8ParsableP15parseBinaryDataAA0A6PacketVSg10Foundation0F0VF"></a>
|
||||
<a name="/s:8SocketIO0A8ParsableP15parseBinaryDatayAA0A6PacketVSg10Foundation0F0VF"></a>
|
||||
<a name="//apple_ref/swift/Method/parseBinaryData(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8ParsableP15parseBinaryDataAA0A6PacketVSg10Foundation0F0VF">parseBinaryData(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8ParsableP15parseBinaryDatayAA0A6PacketVSg10Foundation0F0VF">parseBinaryData(_:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -270,9 +273,9 @@ into the correct placeholder.</p>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A8ParsableP05parseA7MessageAA0A6PacketVSgSSF"></a>
|
||||
<a name="/s:8SocketIO0A8ParsableP05parseA7MessageyAA0A6PacketVSgSSF"></a>
|
||||
<a name="//apple_ref/swift/Method/parseSocketMessage(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A8ParsableP05parseA7MessageAA0A6PacketVSgSSF">parseSocketMessage(_:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A8ParsableP05parseA7MessageyAA0A6PacketVSgSSF">parseSocketMessage(_:)</a>
|
||||
</code>
|
||||
<span class="declaration-note">
|
||||
Default implementation
|
||||
@@ -333,7 +336,7 @@ into the correct placeholder.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+4
-1
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -291,7 +294,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -262,9 +265,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12EventHandlerV8callbackySayypG_AA0A10AckEmitterCtcvp"></a>
|
||||
<a name="/s:8SocketIO0A12EventHandlerV8callbackyySayypG_AA0A10AckEmitterCtcvp"></a>
|
||||
<a name="//apple_ref/swift/Property/callback" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12EventHandlerV8callbackySayypG_AA0A10AckEmitterCtcvp">callback</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12EventHandlerV8callbackyySayypG_AA0A10AckEmitterCtcvp">callback</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -300,9 +303,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A12EventHandlerV15executeCallbackySayypG4with_Si0G3AckAA0A8IOClientC0gA0tF"></a>
|
||||
<a name="/s:8SocketIO0A12EventHandlerV15executeCallback4with0G3Ack0gA0ySayypG_SiAA0A8IOClientCtF"></a>
|
||||
<a name="//apple_ref/swift/Method/executeCallback(with:withAck:withSocket:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A12EventHandlerV15executeCallbackySayypG4with_Si0G3AckAA0A8IOClientC0gA0tF">executeCallback(with:withAck:withSocket:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A12EventHandlerV15executeCallback4with0G3Ack0gA0ySayypG_SiAA0A8IOClientCtF">executeCallback(with:withAck:withSocket:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -375,7 +378,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -462,9 +465,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:s10CollectionP7ElementQz5IndexQzcip"></a>
|
||||
<a name="/s:Sly7ElementQz5IndexQzcip"></a>
|
||||
<a name="//apple_ref/swift/Method/subscript(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:s10CollectionP7ElementQz5IndexQzcip">subscript(_:)</a>
|
||||
<a class="token" href="#/s:Sly7ElementQz5IndexQzcip">subscript(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -488,9 +491,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:s10CollectionP11SubSequenceQzs5RangeVy5IndexQzGcip"></a>
|
||||
<a name="/s:Sly11SubSequenceQzSny5IndexQzGcip"></a>
|
||||
<a name="//apple_ref/swift/Method/subscript(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:s10CollectionP11SubSequenceQzs5RangeVy5IndexQzGcip">subscript(_:)</a>
|
||||
<a class="token" href="#/s:Sly11SubSequenceQzSny5IndexQzGcip">subscript(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -525,9 +528,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A21IOClientConfigurationVAcA0aC6OptionO12arrayLiterald_tcfc"></a>
|
||||
<a name="/s:8SocketIO0A21IOClientConfigurationV12arrayLiteralAcA0aC6OptionOd_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(arrayLiteral:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A21IOClientConfigurationVAcA0aC6OptionO12arrayLiterald_tcfc">init(arrayLiteral:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A21IOClientConfigurationV12arrayLiteralAcA0aC6OptionOd_tcfc">init(arrayLiteral:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -613,9 +616,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A21IOClientConfigurationV5indexS2i5after_tF"></a>
|
||||
<a name="/s:8SocketIO0A21IOClientConfigurationV5index5afterS2i_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/index(after:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A21IOClientConfigurationV5indexS2i5after_tF">index(after:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A21IOClientConfigurationV5index5afterS2i_tF">index(after:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -643,9 +646,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A21IOClientConfigurationV6insertyAA0aC6OptionO_Sb9replacingtF"></a>
|
||||
<a name="/s:8SocketIO0A21IOClientConfigurationV6insert_9replacingyAA0aC6OptionO_SbtF"></a>
|
||||
<a name="//apple_ref/swift/Method/insert(_:replacing:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A21IOClientConfigurationV6insertyAA0aC6OptionO_Sb9replacingtF">insert(_:replacing:)</a>
|
||||
<a class="token" href="#/s:8SocketIO0A21IOClientConfigurationV6insert_9replacingyAA0aC6OptionO_SbtF">insert(_:replacing:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -706,7 +709,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -498,7 +501,7 @@ event type packets.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="../../Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -201,9 +204,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO7connectA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO7connectyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/connect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO7connectA2EmF">connect</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO7connectyA2EmF">connect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -232,9 +235,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO10disconnectA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO10disconnectyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/disconnect" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO10disconnectA2EmF">disconnect</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO10disconnectyA2EmF">disconnect</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -263,9 +266,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO5eventA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO5eventyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/event" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO5eventA2EmF">event</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO5eventyA2EmF">event</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -294,9 +297,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO3ackA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO3ackyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/ack" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO3ackA2EmF">ack</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO3ackyA2EmF">ack</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -325,9 +328,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO5errorA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO5erroryA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO5errorA2EmF">error</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO5erroryA2EmF">error</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -356,9 +359,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO11binaryEventA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO11binaryEventyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/binaryEvent" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO11binaryEventA2EmF">binaryEvent</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO11binaryEventyA2EmF">binaryEvent</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -387,9 +390,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO9binaryAckA2EmF"></a>
|
||||
<a name="/s:8SocketIO0A6PacketV0C4TypeO9binaryAckyA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/binaryAck" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO9binaryAckA2EmF">binaryAck</a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO9binaryAckyA2EmF">binaryAck</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -413,13 +416,51 @@
|
||||
</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:8SocketIO0A6PacketV0C4TypeO8isBinarySbvp"></a>
|
||||
<a name="//apple_ref/swift/Property/isBinary" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO0A6PacketV0C4TypeO8isBinarySbvp">isBinary</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Whether or not this type is binary</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isBinary</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+31
-1
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -245,6 +248,33 @@
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:8SocketIO4Posta"></a>
|
||||
<a name="//apple_ref/swift/Alias/Post" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:8SocketIO4Posta">Post</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 queued POST</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Post</span> <span class="o">=</span> <span class="p">(</span><span class="nv">msg</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">-></span> <span class="p">())?)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -253,7 +283,7 @@
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+4
-1
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -229,7 +232,7 @@ will be released, along with the socket, and its memory reclaimed.</p>
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+7
-4
@@ -173,6 +173,9 @@
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO14NormalCallbacka">NormalCallback</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a class="nav-group-task-link" href="Typealiases.html#/s:8SocketIO4Posta">Post</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -266,7 +269,7 @@ SocketIOClient* socket = manager.defaultSocket;
|
||||
<span class="o">.</span><span class="nf">executable</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="s">"socket.io-test"</span><span class="p">,</span> <span class="nv">targets</span><span class="p">:</span> <span class="p">[</span><span class="s">"YourTargetName"</span><span class="p">])</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">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="o">.</span><span class="nf">upToNextMinor</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="s">"13.2.0"</span><span class="p">))</span>
|
||||
<span class="o">.</span><span class="nf">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="o">.</span><span class="nf">upToNextMinor</span><span class="p">(</span><span class="nv">from</span><span class="p">:</span> <span class="s">"13.3.0"</span><span class="p">))</span>
|
||||
<span class="p">],</span>
|
||||
<span class="nv">targets</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="o">.</span><span class="nf">target</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="s">"YourTargetName"</span><span class="p">,</span> <span class="nv">dependencies</span><span class="p">:</span> <span class="p">[</span><span class="s">"SocketIO"</span><span class="p">],</span> <span class="nv">path</span><span class="p">:</span> <span class="s">"./Path/To/Your/Sources"</span><span class="p">)</span>
|
||||
@@ -278,7 +281,7 @@ SocketIOClient* socket = manager.defaultSocket;
|
||||
<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" ~> 13.2.0
|
||||
<pre class="highlight plaintext"><code>github "socketio/socket.io-client-swift" ~> 13.3.0
|
||||
</code></pre>
|
||||
|
||||
<p>Run <code>carthage update --platform ios,macosx</code>.</p>
|
||||
@@ -290,7 +293,7 @@ SocketIOClient* socket = manager.defaultSocket;
|
||||
<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">'~> 13.2.0'</span>
|
||||
<span class="n">pod</span> <span class="s1">'Socket.IO-Client-Swift'</span><span class="p">,</span> <span class="s1">'~> 13.3.0'</span>
|
||||
<span class="k">end</span>
|
||||
</code></pre>
|
||||
|
||||
@@ -331,7 +334,7 @@ SocketIOClient* socket = manager.defaultSocket;
|
||||
</article>
|
||||
</div>
|
||||
<section class="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-05-16)</p>
|
||||
<p>© 2018 <a class="link" href="https://github.com/socketio/socket.io-client-swift" target="_blank" rel="external">Erik</a>. All rights reserved. (Last updated: 2018-11-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"Typealiases.html#/s:8SocketIO11AckCallbacka":{"name":"AckCallback","abstract":"<p>A typealias for an ack callback.</p>"},"Typealiases.html#/s:8SocketIO14NormalCallbacka":{"name":"NormalCallback","abstract":"<p>A typealias for a normal callback.</p>"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO7connectA2EmF":{"name":"connect","abstract":"<p>Connect: 0</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO10disconnectA2EmF":{"name":"disconnect","abstract":"<p>Disconnect: 1</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO5eventA2EmF":{"name":"event","abstract":"<p>Event: 2</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO3ackA2EmF":{"name":"ack","abstract":"<p>Ack: 3</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO5errorA2EmF":{"name":"error","abstract":"<p>Error: 4</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO11binaryEventA2EmF":{"name":"binaryEvent","abstract":"<p>Binary Event: 5</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO9binaryAckA2EmF":{"name":"binaryAck","abstract":"<p>Binary Ack: 6</p>","parent_name":"PacketType"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV3nspSSvp":{"name":"nsp","abstract":"<p>The namespace for this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV2idSivp":{"name":"id","abstract":"<p>If > 0 then this packet is using acking.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV4typeAC0C4TypeOvp":{"name":"type","abstract":"<p>The type of this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV6binarySay10Foundation4DataVGvp":{"name":"binary","abstract":"<p>An array of binary data for this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV4dataSayypGvp":{"name":"data","abstract":"<p>The data for this event.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV4argsSayypGvp":{"name":"args","abstract":"<p>Returns the payload for this packet, minus the event name if this is an event or binaryEvent type packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV11descriptionSSvp":{"name":"description","abstract":"<p>A string representation of this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV5eventSSvp":{"name":"event","abstract":"<p>The event name for this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV12packetStringSSvp":{"name":"packetString","abstract":"<p>A string representation of this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket/PacketType.html":{"name":"PacketType","abstract":"<p>The type of packets.</p>","parent_name":"SocketPacket"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV7Elementa":{"name":"Element","abstract":"<p>Type of element stored.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV5Indexa":{"name":"Index","abstract":"<p>Index type.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV8Iteratora":{"name":"Iterator","abstract":"<p>Iterator type.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV11SubSequencea":{"name":"SubSequence","abstract":"<p>SubSequence type.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV10startIndexSivp":{"name":"startIndex","abstract":"<p>The start index of this collection.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV8endIndexSivp":{"name":"endIndex","abstract":"<p>The end index of this collection.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV7isEmptySbvp":{"name":"isEmpty","abstract":"<p>Whether this collection is empty.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV5countSivp":{"name":"count","abstract":"<p>The number of elements stored in this collection.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV5firstAA0aC6OptionOSgvp":{"name":"first","abstract":"<p>The first element in this collection.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:s10Line truncated
|
||||
{"Typealiases.html#/s:8SocketIO11AckCallbacka":{"name":"AckCallback","abstract":"<p>A typealias for an ack callback.</p>"},"Typealiases.html#/s:8SocketIO14NormalCallbacka":{"name":"NormalCallback","abstract":"<p>A typealias for a normal callback.</p>"},"Typealiases.html#/s:8SocketIO4Posta":{"name":"Post","abstract":"<p>A typealias for a queued POST</p>"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO7connectyA2EmF":{"name":"connect","abstract":"<p>Connect: 0</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO10disconnectyA2EmF":{"name":"disconnect","abstract":"<p>Disconnect: 1</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO5eventyA2EmF":{"name":"event","abstract":"<p>Event: 2</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO3ackyA2EmF":{"name":"ack","abstract":"<p>Ack: 3</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO5erroryA2EmF":{"name":"error","abstract":"<p>Error: 4</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO11binaryEventyA2EmF":{"name":"binaryEvent","abstract":"<p>Binary Event: 5</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO9binaryAckyA2EmF":{"name":"binaryAck","abstract":"<p>Binary Ack: 6</p>","parent_name":"PacketType"},"Structs/SocketPacket/PacketType.html#/s:8SocketIO0A6PacketV0C4TypeO8isBinarySbvp":{"name":"isBinary","abstract":"<p>Whether or not this type is binary</p>","parent_name":"PacketType"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV3nspSSvp":{"name":"nsp","abstract":"<p>The namespace for this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV2idSivp":{"name":"id","abstract":"<p>If > 0 then this packet is using acking.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV4typeAC0C4TypeOvp":{"name":"type","abstract":"<p>The type of this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV6binarySay10Foundation4DataVGvp":{"name":"binary","abstract":"<p>An array of binary data for this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV4dataSayypGvp":{"name":"data","abstract":"<p>The data for this event.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV4argsSayypGvp":{"name":"args","abstract":"<p>Returns the payload for this packet, minus the event name if this is an event or binaryEvent type packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV11descriptionSSvp":{"name":"description","abstract":"<p>A string representation of this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV5eventSSvp":{"name":"event","abstract":"<p>The event name for this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket.html#/s:8SocketIO0A6PacketV12packetStringSSvp":{"name":"packetString","abstract":"<p>A string representation of this packet.</p>","parent_name":"SocketPacket"},"Structs/SocketPacket/PacketType.html":{"name":"PacketType","abstract":"<p>The type of packets.</p>","parent_name":"SocketPacket"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV7Elementa":{"name":"Element","abstract":"<p>Type of element stored.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV5Indexa":{"name":"Index","abstract":"<p>Index type.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV8Iteratora":{"name":"Iterator","abstract":"<p>Iterator type.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV11SubSequencea":{"name":"SubSequence","abstract":"<p>SubSequence type.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV10startIndexSivp":{"name":"startIndex","abstract":"<p>The start index of this collection.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV8endIndexSivp":{"name":"endIndex","abstract":"<p>The end index of this collection.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV7isEmptySbvp":{"name":"isEmpty","abstract":"<p>Whether this collection is empty.</p>","parent_name":"SocketIOClientConfiguration"},"Structs/SocketIOClientConfiguration.html#/s:8SocketIO0A21IOClientConfigurationV5countSivp":{"name":"count","abstract":"<p>The number of elements stored in this collection.</p>","parent_name":"SocketLine truncated
|
||||
Reference in new issue
Block a user