This repository was archived by the owner on May 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ typedef enum {
107
107
- (void ) connectToHost : (NSString *)host onPort : (NSInteger )port ;
108
108
- (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params ;
109
109
- (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params withNamespace : (NSString *)endpoint ;
110
+ - (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params withNamespace : (NSString *)endpoint withConnectionTimeout : (NSTimeInterval ) connectionTimeout ;
111
+
110
112
- (void ) disconnect ;
111
113
112
114
- (void ) sendMessage : (NSString *)data ;
Original file line number Diff line number Diff line change @@ -95,15 +95,19 @@ - (id) initWithDelegate:(id<SocketIODelegate>)delegate
95
95
96
96
- (void ) connectToHost : (NSString *)host onPort : (NSInteger )port
97
97
{
98
- [self connectToHost: host onPort: port withParams: nil withNamespace: @" " ];
98
+ [self connectToHost: host onPort: port withParams: nil withNamespace: @" " withConnectionTimeout: 10 . 0f ];
99
99
}
100
100
101
101
- (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params
102
102
{
103
- [self connectToHost: host onPort: port withParams: params withNamespace: @" " ];
103
+ [self connectToHost: host onPort: port withParams: params withNamespace: @" " withConnectionTimeout: 10 . 0f ];
104
104
}
105
105
106
- - (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params withNamespace : (NSString *)endpoint
106
+ - (void )connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params withNamespace : (NSString *)endpoint {
107
+ [self connectToHost: host onPort: port withParams: params withNamespace: @" " withConnectionTimeout: 10 .0f ];
108
+ }
109
+
110
+ - (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params withNamespace : (NSString *)endpoint withConnectionTimeout : (NSTimeInterval )connectionTimeout
107
111
{
108
112
if (!_isConnected && !_isConnecting) {
109
113
_isConnecting = YES ;
@@ -138,7 +142,7 @@ - (void) connectToHost:(NSString *)host onPort:(NSInteger)port withParams:(NSDic
138
142
// make a request
139
143
NSURLRequest *request = [NSURLRequest requestWithURL: url
140
144
cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData
141
- timeoutInterval: 10.0 ];
145
+ timeoutInterval: connectionTimeout ];
142
146
143
147
_handshake = [[NSURLConnection alloc ] initWithRequest: request
144
148
delegate: self startImmediately: NO ];
You can’t perform that action at this time.
0 commit comments