Set reconnectAttempts in manager. Fixes #989

This commit is contained in:
Erik Little 2018-03-30 09:39:56 -04:00
parent 731aaf4203
commit d24e8f83c6
No known key found for this signature in database
GPG Key ID: 62F837E56F4E9320
4 changed files with 15 additions and 11 deletions

View File

@ -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
osx_image: xcode9.2
branches:
only:
- master

View File

@ -1,15 +1,6 @@
{
"object": {
"pins": [
{
"package": "SSCZLib",
"repositoryURL": "https://github.com/daltoniam/zlib-spm.git",
"state": {
"branch": null,
"revision": "83ac8d719a2f3aa775dbdf116a57f56fb2c49abb",
"version": "1.1.0"
}
},
{
"package": "SSCommonCrypto",
"repositoryURL": "https://github.com/daltoniam/common-crypto-spm",
@ -27,6 +18,15 @@
"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"
}
}
]
},

View File

@ -476,6 +476,8 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
self.handleQueue = queue
case let .reconnects(reconnects):
self.reconnects = reconnects
case let .reconnectAttempts(attempts):
self.reconnectAttempts = attempts
case let .reconnectWait(wait):
reconnectWait = abs(wait)
case let .log(log):

View File

@ -79,13 +79,15 @@ class SocketMangerTest : XCTestCase {
.handleQueue(queue),
.forceNew(true),
.reconnects(false),
.reconnectWait(5)
.reconnectWait(5),
.reconnectAttempts(5)
])
XCTAssertEqual(manager.handleQueue, queue)
XCTAssertTrue(manager.forceNew)
XCTAssertFalse(manager.reconnects)
XCTAssertEqual(manager.reconnectWait, 5)
XCTAssertEqual(manager.reconnectAttempts, 5)
}
func testManagerRemovesSocket() {