You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
784 B

4 months ago
  1. /*
  2. * IXSocketConnect.h
  3. * Author: Benjamin Sergeant
  4. * Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
  5. */
  6. #pragma once
  7. #include "IXCancellationRequest.h"
  8. #include <string>
  9. struct addrinfo;
  10. namespace ix
  11. {
  12. class SocketConnect
  13. {
  14. public:
  15. static int connect(const std::string& hostname,
  16. int port,
  17. std::string& errMsg,
  18. const CancellationRequest& isCancellationRequested);
  19. static void configure(int sockfd);
  20. private:
  21. static int connectToAddress(const struct addrinfo* address,
  22. std::string& errMsg,
  23. const CancellationRequest& isCancellationRequested);
  24. };
  25. } // namespace ix