91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 329KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-29
  • 語言: 其他
  • 標簽: ios??

資源簡介

oc開發,服務器端啟動mqtt服務端,手機端使用mqtt客戶端,動態獲取推送消息,參考demo

資源截圖

代碼片段和文件信息

//
//??ForegroundReconnection.m
//??MQTTClient
//
//??Created?by?Josip?Cavar?on?22/08/2017.
//??Copyright???2017?Christoph?Krey.?All?rights?reserved.
//

#import?“ForegroundReconnection.h“

#if?TARGET_OS_IPHONE?==?1
#import?“MQTTSessionManager.h“
#import?
@interface?ForegroundReconnection?()

@property?(nonatomic)?UIBackgroundTaskIdentifier?backgroundTask;

@end

@implementation?ForegroundReconnection

-?(instancetype)initWithMQTTSessionManager:(MQTTSessionManager?*)manager?{
????self?=?[super?init];
????self.sessionManager?=?manager;
????self.backgroundTask?=?UIBackgroundTaskInvalid;
????
????NSNotificationCenter?*defaultCenter?=?[NSNotificationCenter?defaultCenter];
????
????[defaultCenter?addObserver:self
??????????????????????selector:@selector(appWillResignActive)
??????????????????????????name:UIApplicationWillResignActiveNotification
????????????????????????object:nil];
????
????[defaultCenter?addObserver:self
??????????????????????selector:@selector(appDidEnterBackground)
??????????????????????????name:UIApplicationDidEnterBackgroundNotification
????????????????????????object:nil];
????
????[defaultCenter?addObserver:self
??????????????????????selector:@selector(appDidBecomeActive)
??????????????????????????name:UIApplicationDidBecomeActiveNotification
????????????????????????object:nil];
????return?self;
}

-?(void)dealloc?{
????NSNotificationCenter?*defaultCenter?=?[NSNotificationCenter?defaultCenter];
????[defaultCenter?removeObserver:self?name:UIApplicationWillResignActiveNotification?object:nil];
????[defaultCenter?removeObserver:self?name:UIApplicationDidEnterBackgroundNotification?object:nil];
????[defaultCenter?removeObserver:self?name:UIApplicationDidBecomeActiveNotification?object:nil];
}

-?(void)appWillResignActive?{
????[self.sessionManager?disconnectWithDisconnectHandler:nil];
}

-?(void)appDidEnterBackground?{
????if?(!self.sessionManager.requiresTearDown)?{
????????//?we?don‘t?want?to?tear?down?session?as?it‘s?already?closed
????????return;
????}
????
????__weak?typeof(self)?weakSelf?=?self;
????self.backgroundTask?=?[[UIApplication?sharedApplication]?beginBackgroundTaskWithExpirationHandler:^{
????????__strong?typeof(weakSelf)?strongSelf?=?weakSelf;
????????[strongSelf?endBackgroundTask];
????}];
}

-?(void)appDidBecomeActive?{
????[self.sessionManager?connectToLast:nil];
}

-?(void)endBackgroundTask?{
????if?(self.backgroundTask)?{
????????[[UIApplication?sharedApplication]?endBackgroundTask:self.backgroundTask];
????????self.backgroundTask?=?UIBackgroundTaskInvalid;
????}
}

@end

#endif

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\
?????文件?????????220??2018-02-16?09:43??MQTT-Client-framework-master\.gitignore
?????文件?????????317??2018-02-16?09:43??MQTT-Client-framework-master\.travis.yml
?????文件???????10497??2018-02-16?09:43??MQTT-Client-framework-master\CHANGELOG.md
?????文件???????12922??2018-02-16?09:43??MQTT-Client-framework-master\LICENSE
?????文件????????4506??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient.podspec
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\
?????文件??????135441??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\project.pbxproj
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\project.xcworkspace\
?????文件?????????155??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\project.xcworkspace\contents.xcworkspacedata
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\xcshareddata\
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\xcshareddata\xcschemes\
?????文件????????3746??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\xcshareddata\xcschemes\MQTTClientiOS.xcscheme
?????文件????????3758??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\xcshareddata\xcschemes\MQTTClientmacOS.xcscheme
?????文件????????3752??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcodeproj\xcshareddata\xcschemes\MQTTClienttvOS.xcscheme
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcworkspace\
?????文件?????????228??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcworkspace\contents.xcworkspacedata
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcworkspace\xcshareddata\
?????文件????????1677??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient.xcworkspace\xcshareddata\MQTTClient.xcscmblueprint
?????目錄???????????0??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\
?????文件??????101124??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\Doxyfile
?????文件?????????444??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\ForegroundReconnection.h
?????文件????????2576??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\ForegroundReconnection.m
?????文件?????????496??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\GCDTimer.h
?????文件????????1691??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\GCDTimer.m
?????文件????????1009??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\MQTTCFSocketDecoder.h
?????文件????????2710??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\MQTTCFSocketDecoder.m
?????文件?????????957??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\MQTTCFSocketEncoder.h
?????文件????????3580??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\MQTTCFSocketEncoder.m
?????文件????????2522??2018-02-16?09:43??MQTT-Client-framework-master\MQTTClient\MQTTClient\MQTTCFSocketTransport.h
............此處省略203個文件信息

評論

共有 條評論