Pierre-Olivier Latour 11 年之前
父节点
当前提交
5a0c274807
共有 2 个文件被更改,包括 28 次插入28 次删除
  1. 17 17
      GCDWebServer/Core/GCDWebServer.h
  2. 11 11
      GCDWebServer/Core/GCDWebServer.m

+ 17 - 17
GCDWebServer/Core/GCDWebServer.h

@@ -284,23 +284,6 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
  */
  */
 - (void)removeAllHandlers;
 - (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
  *  Starts the server with explicit options. This method is the designated way
  *  to start the server.
  *  to start the server.
@@ -337,6 +320,23 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
  */
  */
 @property(nonatomic, readonly) NSURL* bonjourServerURL;
 @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
 #if !TARGET_OS_IPHONE
 
 
 /**
 /**

+ 11 - 11
GCDWebServer/Core/GCDWebServer.m

@@ -528,17 +528,6 @@ static inline NSString* _EncodeBase64(NSString* string) {
   }
   }
 }
 }
 
 
-- (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
 #if TARGET_OS_IPHONE
 
 
 - (void)_didEnterBackground:(NSNotification*)notification {
 - (void)_didEnterBackground:(NSNotification*)notification {
@@ -640,6 +629,17 @@ static inline NSString* _EncodeBase64(NSString* string) {
   return nil;
   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
 #if !TARGET_OS_IPHONE
 
 
 - (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name {
 - (BOOL)runWithPort:(NSUInteger)port bonjourName:(NSString*)name {