FBWebServer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import <Foundation/Foundation.h>
  10. @class RouteResponse, RoutingHTTPServer, FBExceptionHandler;
  11. @protocol FBWebServerDelegate;
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. HTTP and USB service wrapper, handling requests and responses
  15. */
  16. @interface FBWebServer : NSObject
  17. /**
  18. Server delegate.
  19. */
  20. @property (weak, nonatomic) id<FBWebServerDelegate> delegate;
  21. /**
  22. Starts WebDriverAgent service by booting HTTP and USB server
  23. */
  24. - (void)startServing;
  25. /**
  26. Stops WebDriverAgent service, shutting down HTTP and USB servers.
  27. */
  28. - (void)stopServing;
  29. @end
  30. /**
  31. The protocol allowing the server delegate to handle messages from the server.
  32. */
  33. @protocol FBWebServerDelegate <NSObject>
  34. /**
  35. The server requested WebDriverAgent service shutdown.
  36. @param webServer Server instance.
  37. */
  38. - (void)webServerDidRequestShutdown:(FBWebServer *)webServer;
  39. @end
  40. NS_ASSUME_NONNULL_END