From dd28b1747ca467262f0d61b847d056d46afc99e9 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 1 Apr 2015 15:42:23 -0400 Subject: [PATCH] add connection options --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d733a9..15852f6 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,17 @@ import Socket_IO_Client_Swift ##API Constructors ----------- -`init(socketURL: String, opts:NSDictionary? = nil)` - Constructs a new client for the given URL. opts can be omitted (will use default values. See example) +`init(socketURL: String, opts:NSDictionary? = nil)` - Constructs a new client for the given URL. opts can be omitted (will use default values) + +Options +------- +- `reconnects: Bool` Default is `true` +- `reconnectAttempts: Int` Default is `-1` (infinite tries) +- `reconnectWait: Int` Default is `10` +- `forcePolling: Bool` Default is `false`. `true` forces the client to use xhr-polling. +- `forceWebsockets: Bool` Default is `false`. `true` forces the client to use WebSockets. +- `nsp: String` Default is `"/"` +- `cookies: [NSHTTPCookie]?` An array of NSHTTPCookies. Passed during the handshake. Default is nil. `convenience init(socketURL: String, options:NSDictionary?)` - Same as above, but meant for Objective-C. See Objective-C Example. Methods