diff --git a/Core/Source/DTBonjourServer.h b/Core/Source/DTBonjourServer.h index ca0dffe..5021b12 100644 --- a/Core/Source/DTBonjourServer.h +++ b/Core/Source/DTBonjourServer.h @@ -17,12 +17,19 @@ @optional /** - Callend when a new incoming connection was accepted by the server. + Called when a new incoming connection was accepted by the server. @param server The server @param connection The connection that was accepted */ - (void)bonjourServer:(DTBonjourServer *)server didAcceptConnection:(DTBonjourDataConnection *)connection; +/** + Called when a client connection was closed. + @param server The server + @param connection The connection that was closed + */ +- (void)bonjourServer:(DTBonjourServer *)server didCloseConnection:(DTBonjourDataConnection *)connection; + /** Called when the server received a new object on a given connection @param server The server diff --git a/Core/Source/DTBonjourServer.m b/Core/Source/DTBonjourServer.m index ecc0289..b67e3dd 100644 --- a/Core/Source/DTBonjourServer.m +++ b/Core/Source/DTBonjourServer.m @@ -393,6 +393,10 @@ - (void)connection:(DTBonjourDataConnection *)connection didReceiveObject:(id)ob - (void)connectionDidClose:(DTBonjourDataConnection *)connection { [_connections removeObject:connection]; + if ([_delegate respondsToSelector:@selector(bonjourServer:didCloseConnection:)]) + { + [_delegate bonjourServer:self didCloseConnection:connection]; + } } #pragma mark - Notifications diff --git a/DTBonjour.podspec b/DTBonjour.podspec index c9457a6..4831870 100644 --- a/DTBonjour.podspec +++ b/DTBonjour.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'DTBonjour' - spec.version = '1.1.1' + spec.version = '1.1.2' spec.summary = "Client/Server Communication of NSObjects over WiFi." spec.homepage = "https://github.com/Cocoanetics/DTBonjour" spec.author = { "Oliver Drobnik" => "oliver@drobnik.com" } diff --git a/DTBonjour.xcodeproj/project.pbxproj b/DTBonjour.xcodeproj/project.pbxproj index fab3d2a..3fb2fe5 100644 --- a/DTBonjour.xcodeproj/project.pbxproj +++ b/DTBonjour.xcodeproj/project.pbxproj @@ -330,6 +330,10 @@ A719022816A7F5E300C1EC52 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); DSTROOT = /tmp/DTBonjour.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Core/DTBonjour-Prefix.pch"; @@ -340,6 +344,10 @@ A719022916A7F5E300C1EC52 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); DSTROOT = /tmp/DTBonjour.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Core/DTBonjour-Prefix.pch"; @@ -376,6 +384,73 @@ }; name = Release; }; + A73FC7261AB189C90052DC07 /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "COVERAGE=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Coverage; + }; + A73FC7271AB189C90052DC07 /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + "$(ARCHS_STANDARD)", + armv7s, + ); + DSTROOT = /tmp/DTBonjour.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Core/DTBonjour-Prefix.pch"; + PRODUCT_NAME = DTBonjour_iOS; + }; + name = Coverage; + }; + A73FC7281AB189C90052DC07 /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Core/DTBonjour-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + PRODUCT_NAME = DTBonjour_Mac; + SDKROOT = macosx; + }; + name = Coverage; + }; + A73FC7291AB189C90052DC07 /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Coverage; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -383,6 +458,7 @@ isa = XCConfigurationList; buildConfigurations = ( A70B24A316E1389D008C4BB8 /* Debug */, + A73FC7291AB189C90052DC07 /* Coverage */, A70B24A416E1389D008C4BB8 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -392,6 +468,7 @@ isa = XCConfigurationList; buildConfigurations = ( A719022516A7F5E300C1EC52 /* Debug */, + A73FC7261AB189C90052DC07 /* Coverage */, A719022616A7F5E300C1EC52 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -401,6 +478,7 @@ isa = XCConfigurationList; buildConfigurations = ( A719022816A7F5E300C1EC52 /* Debug */, + A73FC7271AB189C90052DC07 /* Coverage */, A719022916A7F5E300C1EC52 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -410,6 +488,7 @@ isa = XCConfigurationList; buildConfigurations = ( A719029416A7F93000C1EC52 /* Debug */, + A73FC7281AB189C90052DC07 /* Coverage */, A719029516A7F93000C1EC52 /* Release */, ); defaultConfigurationIsVisible = 0; diff --git a/Documentation/Change Log-template.markdown b/Documentation/Change Log-template.markdown index 4bdd433..b9e7a0f 100644 --- a/Documentation/Change Log-template.markdown +++ b/Documentation/Change Log-template.markdown @@ -3,6 +3,11 @@ Change Log This is the history of version updates. +**Version 1.1.2** + +- Added delegate method to DTBonjourServerDelegate to notifiy about client disconnect +- FIXED: unit testing and code coverage + **Version 1.1.1** - FIXED: Various Xcode warnings diff --git a/readme.markdown b/readme.markdown index 032a84b..4e07b55 100644 --- a/readme.markdown +++ b/readme.markdown @@ -1,7 +1,7 @@ About DTBonjour ================== -[![Build Status](https://travis-ci.org/Cocoanetics/DTBonjour.png?branch=develop)](https://travis-ci.org/Cocoanetics/DTFoundation) [![Coverage Status](https://coveralls.io/repos/Cocoanetics/DTFoundation/badge.png?branch=develop)](https://coveralls.io/r/Cocoanetics/DTBonjour?branch=develop) +[![Build Status](https://travis-ci.org/Cocoanetics/DTBonjour.png?branch=develop)](https://travis-ci.org/Cocoanetics/DTBonjour) [![Coverage Status](https://coveralls.io/repos/Cocoanetics/DTFoundation/badge.png?branch=develop)](https://coveralls.io/r/Cocoanetics/DTBonjour?branch=develop) DTBonjour had its origin when I wanted communicate between a Mac app and an iOS app. It greatly simplifies networking over WiFi by giving you an easy method to transmit any NSObject that conforms to NSCoding.