File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
191191 */
192192- (void )webServerDidStart : (GCDWebServer*)server ;
193193
194+ /* *
195+ * This method is called after the Bonjour registration for the server has
196+ * successfully completed.
197+ */
198+ - (void )webServerDidCompleteBonjourRegistration : (GCDWebServer*)server ;
199+
194200/* *
195201 * This method is called when the first GCDWebServerConnection is opened by the
196202 * server to serve a series of HTTP requests. A series is ongoing as long as
Original file line number Diff line number Diff line change @@ -335,12 +335,16 @@ - (void)removeAllHandlers {
335335}
336336
337337static void _NetServiceClientCallBack (CFNetServiceRef service, CFStreamError* error, void * info) {
338+ DCHECK ([NSThread isMainThread ]);
338339 @autoreleasepool {
339340 if (error->error ) {
340341 LOG_ERROR (@" Bonjour error %i (domain %i )" , (int )error->error , (int )error->domain );
341342 } else {
342343 GCDWebServer* server = (ARC_BRIDGE GCDWebServer*)info;
343344 LOG_INFO (@" %@ now reachable at %@ " , [server class ], server.bonjourServerURL );
345+ if ([server.delegate respondsToSelector: @selector (webServerDidCompleteBonjourRegistration: )]) {
346+ [server.delegate webServerDidCompleteBonjourRegistration: server];
347+ }
344348 }
345349 }
346350}
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ - (void)webServerDidStart:(GCDWebServer*)server {
6565 [self _logDelegateCall: _cmd ];
6666}
6767
68+ - (void )webServerDidCompleteBonjourRegistration : (GCDWebServer*)server {
69+ [self _logDelegateCall: _cmd ];
70+ }
71+
6872- (void )webServerDidConnect : (GCDWebServer*)server {
6973 [self _logDelegateCall: _cmd ];
7074}
You can’t perform that action at this time.
0 commit comments