Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swisspol committed Apr 23, 2014
1 parent 591da12 commit 5a0c274
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
34 changes: 17 additions & 17 deletions GCDWebServer/Core/GCDWebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,6 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
*/
- (void)removeAllHandlers;

/**
* Starts the server on port 8080 (OS X & iOS Simulator) or port 80 (iOS)
* using the computer / device name for as the Bonjour name.
*
* Returns NO if the server failed to start.
*/
- (BOOL)start;

/**
* Starts the server on a given port and with a specific Bonjour name.
* Pass a nil Bonjour name to disable Bonjour entirely or an empty string to
* use the computer / device name.
*
* Returns NO if the server failed to start.
*/
- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name;

/**
* Starts the server with explicit options. This method is the designated way
* to start the server.
Expand Down Expand Up @@ -337,6 +320,23 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
*/
@property(nonatomic, readonly) NSURL* bonjourServerURL;

/**
* Starts the server on port 8080 (OS X & iOS Simulator) or port 80 (iOS)
* using the computer / device name for as the Bonjour name.
*
* Returns NO if the server failed to start.
*/
- (BOOL)start;

/**
* Starts the server on a given port and with a specific Bonjour name.
* Pass a nil Bonjour name to disable Bonjour entirely or an empty string to
* use the computer / device name.
*
* Returns NO if the server failed to start.
*/
- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name;

#if !TARGET_OS_IPHONE

/**
Expand Down
22 changes: 11 additions & 11 deletions GCDWebServer/Core/GCDWebServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -528,17 +528,6 @@ - (void)_stop {
}
}

- (BOOL)start {
return [self startWithPort:kDefaultPort bonjourName:@""];
}

- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name {
NSMutableDictionary* options = [NSMutableDictionary dictionary];
[options setObject:[NSNumber numberWithInteger:port] forKey:GCDWebServerOption_Port];
[options setValue:name forKey:GCDWebServerOption_BonjourName];
return [self startWithOptions:options];
}

#if TARGET_OS_IPHONE

- (void)_didEnterBackground:(NSNotification*)notification {
Expand Down Expand Up @@ -640,6 +629,17 @@ - (NSURL*)bonjourServerURL {
return nil;
}

- (BOOL)start {
return [self startWithPort:kDefaultPort bonjourName:@""];
}

- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name {
NSMutableDictionary* options = [NSMutableDictionary dictionary];
[options setObject:[NSNumber numberWithInteger:port] forKey:GCDWebServerOption_Port];
[options setValue:name forKey:GCDWebServerOption_BonjourName];
return [self startWithOptions:options];
}

#if !TARGET_OS_IPHONE

- (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name {
Expand Down

0 comments on commit 5a0c274

Please sign in to comment.