Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Krey committed May 11, 2016
2 parents 9786201 + 95378a3 commit ed4add4
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE9EF5C41C0628B1009EF667"
BuildableName = "MQTTFramework.framework"
BlueprintName = "MQTTFramework"
ReferencedContainer = "container:MQTTClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8404875D1C51212600569C79"
BuildableName = "MQTTFrameworkTests.xctest"
BlueprintName = "MQTTFrameworkTests"
ReferencedContainer = "container:MQTTClient.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE9EF5C41C0628B1009EF667"
BuildableName = "MQTTFramework.framework"
BlueprintName = "MQTTFramework"
ReferencedContainer = "container:MQTTClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE9EF5C41C0628B1009EF667"
BuildableName = "MQTTFramework.framework"
BlueprintName = "MQTTFramework"
ReferencedContainer = "container:MQTTClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE9EF5C41C0628B1009EF667"
BuildableName = "MQTTFramework.framework"
BlueprintName = "MQTTFramework"
ReferencedContainer = "container:MQTTClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 4 additions & 0 deletions MQTTClient/MQTTClient/MQTTCFSocketDecoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ - (void)open {
}
}

- (void)dealloc {
[self close];
}

- (void)close {
[self.stream close];
[self.stream removeFromRunLoop:self.runLoop forMode:self.runLoopMode];
Expand Down
4 changes: 4 additions & 0 deletions MQTTClient/MQTTClient/MQTTCFSocketEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ - (instancetype)init {
return self;
}

- (void)dealloc {
[self close];
}

- (void)open {
[self.stream setDelegate:self];
[self.stream scheduleInRunLoop:self.runLoop forMode:self.runLoopMode];
Expand Down
2 changes: 2 additions & 0 deletions MQTTClient/MQTTClient/MQTTCFSocketTransport.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ - (void)open {
}

if(!connectError){
self.encoder.delegate = nil;
self.encoder = [[MQTTCFSocketEncoder alloc] init];
self.encoder.stream = CFBridgingRelease(writeStream);
self.encoder.runLoop = self.runLoop;
self.encoder.runLoopMode = self.runLoopMode;
self.encoder.delegate = self;
[self.encoder open];

self.decoder.delegate = nil;
self.decoder = [[MQTTCFSocketDecoder alloc] init];
self.decoder.stream = CFBridgingRelease(readStream);
self.decoder.runLoop = self.runLoop;
Expand Down
4 changes: 4 additions & 0 deletions MQTTClient/MQTTClient/MQTTDecoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ - (instancetype)init {
return self;
}

- (void)dealloc {
[self close];
}

- (void)decodeMessage:(NSData *)data {
NSInputStream *stream = [NSInputStream inputStreamWithData:data];
[self openStream:stream];
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MQTT-Client-Framework
MQTT-Client-Framework
=====================

[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

an Objective-C native MQTT Framework http://mqtt.org

### Tested with
Expand Down

0 comments on commit ed4add4

Please sign in to comment.