File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 24
24
}
25
25
@property (nonatomic , assign ) id <PTPusherConnectionDelegate> delegate;
26
26
@property (nonatomic , readonly , getter =isConnected) BOOL connected;
27
- @property (nonatomic , readonly ) NSString *socketID;
27
+ @property (nonatomic , copy , readonly ) NSString *socketID;
28
28
29
29
// /------------------------------------------------------------------------------------/
30
30
// / @name Initialisation
Original file line number Diff line number Diff line change 13
13
14
14
NSString *const PTPusherConnectionEstablishedEvent = @" connection_established" ;
15
15
16
+ @interface PTPusherConnection ()
17
+ @property (nonatomic , copy ) NSString *socketID;
18
+ @property (nonatomic , assign , readwrite ) BOOL connected;
19
+ @end
20
+
16
21
@implementation PTPusherConnection
17
22
18
23
@synthesize delegate = _delegate;
@@ -72,7 +77,9 @@ - (void)webSocket:(ZTWebSocket*)webSocket didFailWithError:(NSError*)error;
72
77
73
78
- (void )webSocketDidClose : (ZTWebSocket*)webSocket ;
74
79
{
75
- connected = NO ;
80
+ self.connected = NO ;
81
+ self.socketID = nil ;
82
+
76
83
[self .delegate pusherConnectionDidDisconnect: self ];
77
84
}
78
85
@@ -82,8 +89,9 @@ - (void)webSocket:(ZTWebSocket*)webSocket didReceiveMessage:(NSString*)message;
82
89
PTPusherEvent *event = [PTPusherEvent eventFromMessageDictionary: messageDictionary];
83
90
84
91
if ([event.name isEqualToString: PTPusherConnectionEstablishedEvent]) {
85
- socketID = [[event.data objectForKey: @" socket_id" ] copy ];
86
- connected = YES ;
92
+ self.socketID = [event.data objectForKey: @" socket_id" ];
93
+ self.connected = YES ;
94
+
87
95
[self .delegate pusherConnectionDidConnect: self ];
88
96
}
89
97
[self .delegate pusherConnection: self didReceiveEvent: event];
You can’t perform that action at this time.
0 commit comments