// // MQTTCFSocketDecoder.h // MQTTClient.framework // // Copyright © 2013-2016, Christoph Krey // #import typedef NS_ENUM(NSInteger, MQTTCFSocketDecoderState) { MQTTCFSocketDecoderStateInitializing, MQTTCFSocketDecoderStateReady, MQTTCFSocketDecoderStateError }; @class MQTTCFSocketDecoder; @protocol MQTTCFSocketDecoderDelegate - (void)decoder:(MQTTCFSocketDecoder *)sender didReceiveMessage:(NSData *)data; - (void)decoderDidOpen:(MQTTCFSocketDecoder *)sender; - (void)decoder:(MQTTCFSocketDecoder *)sender didFailWithError:(NSError *)error; - (void)decoderdidClose:(MQTTCFSocketDecoder *)sender; @end @interface MQTTCFSocketDecoder : NSObject @property (nonatomic) MQTTCFSocketDecoderState state; @property (strong, nonatomic) NSError *error; @property (strong, nonatomic) NSInputStream *stream; @property (strong, nonatomic) NSRunLoop *runLoop; @property (strong, nonatomic) NSString *runLoopMode; @property (weak, nonatomic ) id delegate; - (void)open; - (void)close; @end