Permalink
Browse files

Implemented disconnection with error method and added delegate callba…

…cks so that the error was not lost.
  • Loading branch information...
gdhaworth committed Jan 19, 2012
1 parent e759b6f commit 362b183f1a2a5ddb93b2697c2e6352b486039fbe
Showing with 4 additions and 0 deletions.
  1. +1 −0 CRVStompClient.h
  2. +3 −0 CRVStompClient.m
View
@@ -29,6 +29,7 @@ typedef enum {
@optional
- (void)stompClientDidDisconnect:(CRVStompClient *)stompService;
+- (void)stompClientWillDisconnect:(CRVStompClient *)stompService withError:(NSError*)error;
- (void)stompClientDidConnect:(CRVStompClient *)stompService;
- (void)serverDidSendReceipt:(CRVStompClient *)stompService withReceiptId:(NSString *)receiptId;
- (void)serverDidSendError:(CRVStompClient *)stompService withErrorMessage:(NSString *)description detailedErrorMessage:(NSString *) theMessage;
View
@@ -306,6 +306,9 @@ - (void)onSocketDidDisconnect:(AsyncSocket *)sock {
}
- (void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err {
+ if([[self delegate] respondsToSelector:@selector(stompClientWillDisconnect:withError:)]) {
+ [[self delegate] stompClientWillDisconnect:self withError:err];
+ }
}
#pragma mark -

0 comments on commit 362b183

Please sign in to comment.