diff --git a/AsyncNetwork.xcodeproj/xcshareddata/xcschemes/AsyncNetwork iOS.xcscheme b/AsyncNetwork.xcodeproj/xcshareddata/xcschemes/AsyncNetwork iOS.xcscheme index 40f1517..b64c745 100644 --- a/AsyncNetwork.xcodeproj/xcshareddata/xcschemes/AsyncNetwork iOS.xcscheme +++ b/AsyncNetwork.xcodeproj/xcshareddata/xcschemes/AsyncNetwork iOS.xcscheme @@ -15,7 +15,7 @@ @@ -29,8 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - diff --git a/AsyncNetwork/AsyncClient.h b/AsyncNetwork/AsyncClient.h index 3a9b74d..798b815 100644 --- a/AsyncNetwork/AsyncClient.h +++ b/AsyncNetwork/AsyncClient.h @@ -60,6 +60,7 @@ - (void)stop; - (void)connectToService:(NSNetService *)service; +- (void)connectToHost:(NSString *)theHost port:(NSUInteger)thePort; - (void)sendCommand:(AsyncCommand)command object:(id)object responseBlock:(AsyncNetworkResponseBlock)block; - (void)sendCommand:(AsyncCommand)command object:(id)object; diff --git a/AsyncNetwork/AsyncClient.m b/AsyncNetwork/AsyncClient.m index ac1897d..9302d46 100644 --- a/AsyncNetwork/AsyncClient.m +++ b/AsyncNetwork/AsyncClient.m @@ -118,6 +118,16 @@ - (void)connectToService:(NSNetService *)service [self.connections addObject:connection]; } +- (void)connectToHost:(NSString *)theHost port:(NSUInteger)thePort +{ + // create and configure a connection + // the connection takes care of resovling the net service + AsyncConnection *connection = [AsyncConnection connectionWithHost:theHost port:thePort]; + connection.delegate = self; + [connection start]; + [self.connections addObject:connection]; +} + // send object to all servers - (void)sendCommand:(AsyncCommand)command object:(id)object responseBlock:(AsyncNetworkResponseBlock)block; {