Skip to content

Commit

Permalink
bump to 0.3.3 + fixes pkyeck#85
Browse files Browse the repository at this point in the history
  • Loading branch information
pkyeck committed Apr 25, 2013
1 parent 9f5f39e commit 79fac8e
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 14 deletions.
6 changes: 5 additions & 1 deletion SocketIO.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIO.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down Expand Up @@ -89,6 +89,9 @@ typedef enum {

// http request
NSMutableData *_httpRequestData;

// get all arguments from ack? (https://github.com/pkyeck/socket.IO-objc/pull/85)
BOOL _returnAllDataFromAck;
}

@property (nonatomic, readonly) NSString *host;
Expand All @@ -98,6 +101,7 @@ typedef enum {
@property (nonatomic) BOOL useSecure;
@property (nonatomic, readonly) BOOL isConnected, isConnecting;
@property (nonatomic, unsafe_unretained) id<SocketIODelegate> delegate;
@property (nonatomic) BOOL returnAllDataFromAck;

- (id) initWithDelegate:(id<SocketIODelegate>)delegate;
- (void) connectToHost:(NSString *)host onPort:(NSInteger)port;
Expand Down
11 changes: 7 additions & 4 deletions SocketIO.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIO.m
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down Expand Up @@ -77,7 +77,8 @@ @implementation SocketIO
isConnecting = _isConnecting,
useSecure = _useSecure,
delegate = _delegate,
heartbeatTimeout = _heartbeatTimeout;
heartbeatTimeout = _heartbeatTimeout,
returnAllDataFromAck = _returnAllDataFromAck;

- (id) initWithDelegate:(id<SocketIODelegate>)delegate
{
Expand All @@ -87,6 +88,7 @@ - (id) initWithDelegate:(id<SocketIODelegate>)delegate
_queue = [[NSMutableArray alloc] init];
_ackCount = 0;
_acks = [[NSMutableDictionary alloc] init];
_returnAllDataFromAck = NO;
}
return self;
}
Expand Down Expand Up @@ -503,7 +505,8 @@ - (void) onData:(NSString *)data
id argsData = nil;
if (argsStr && ![argsStr isEqualToString:@""]) {
argsData = [SocketIOJSONSerialization objectFromJSONData:[argsStr dataUsingEncoding:NSUTF8StringEncoding] error:nil];
if ([argsData count] > 0) {
// either send complete response or only the first arg to callback
if (!_returnAllDataFromAck && [argsData count] > 0) {
argsData = [argsData objectAtIndex:0];
}
}
Expand Down Expand Up @@ -670,7 +673,7 @@ - (void) connectionDidFinishLoading:(NSURLConnection *)connection
connectionFailed = true;
}
else {
// add small buffer of 7sec (magic xD)
// add small buffer of 7sec (magic xD) otherwise heartbeat will be too late and connection is closed
_heartbeatTimeout += 7.0;
}
DEBUGLOG(@"heartbeatTimeout: %f", _heartbeatTimeout);
Expand Down
2 changes: 1 addition & 1 deletion SocketIOJSONSerialization.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOJSONSerialization.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOJSONSerialization.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOJSONSerialization.m
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOPacket.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOPacket.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOPacket.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOPacket.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOTransport.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOTransport.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOTransportWebsocket.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOTransportWebsocket.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOTransportWebsocket.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOTransportWebsocket.m
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOTransportXHR.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOTransportXHR.h
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down
2 changes: 1 addition & 1 deletion SocketIOTransportXHR.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SocketIOTransportXHR.m
// v0.3.2 ARC
// v0.3.3 ARC
//
// based on
// socketio-cocoa https://github.com/fpotter/socketio-cocoa
Expand Down

0 comments on commit 79fac8e

Please sign in to comment.