Permalink
Browse files

Added the ability to specify a different port

  • Loading branch information...
1 parent ffe699d commit 174447f1ef21c2a1222d967485708166073a6365 Brian King committed Dec 9, 2011
Showing with 8 additions and 1 deletion.
  1. +2 −0 src/FrankServer.h
  2. +6 −1 src/FrankServer.m
View
@@ -13,6 +13,8 @@
@interface FrankServer : NSObject {
HTTPServer *_httpServer;
}
++ (void)setDefaultHttpPort:(NSUInteger)port;
+
- (id) initWithDefaultBundle;
- (id) initWithStaticFrankBundleNamed:(NSString *)bundleName;
View
@@ -18,8 +18,13 @@
#import "AppCommand.h"
#import "AccessibilityCheckCommand.h"
+static NSUInteger __defaultPort = FRANK_SERVER_PORT;
@implementation FrankServer
++ (void)setDefaultHttpPort:(NSUInteger)port
+{
+ __defaultPort = port;
+}
- (id) initWithDefaultBundle {
return [self initWithStaticFrankBundleNamed: @"frank_static_resources"];
}
@@ -48,7 +53,7 @@ - (id) initWithStaticFrankBundleNamed:(NSString *)bundleName
[_httpServer setName:@"Frank UISpec server"];
[_httpServer setType:@"_http._tcp."];
[_httpServer setConnectionClass:[RoutingHTTPConnection class]];
- [_httpServer setPort:FRANK_SERVER_PORT];
+ [_httpServer setPort:__defaultPort];
NSLog( @"Creating the server: %@", _httpServer );
}
return self;

0 comments on commit 174447f

Please sign in to comment.