hueplusplus  1.0.0
WinHttpHandler.h
Go to the documentation of this file.
1 
23 #ifndef INCLUDE_HUEPLUSPLUS_WINHTTPHANDLER_H
24 #define INCLUDE_HUEPLUSPLUS_WINHTTPHANDLER_H
25 
26 #include <string>
27 #include <vector>
28 
29 #include <winsock2.h>
30 
31 #include "BaseHttpHandler.h"
32 
33 namespace hueplusplus
34 {
37 {
38 public:
41 
44 
53  std::string send(const std::string& msg, const std::string& adr, int port = 80) const override;
54 
64  std::vector<std::string> sendMulticast(const std::string& msg, const std::string& adr = "239.255.255.250",
65  int port = 1900, std::chrono::steady_clock::duration timeout = std::chrono::seconds(5)) const override;
66 
67 private:
68  WSADATA wsaData;
69 };
70 } // namespace hueplusplus
71 
72 #endif
Namespace for the hueplusplus library.
Definition: Action.h:27
std::vector< std::string > sendMulticast(const std::string &msg, const std::string &adr="239.255.255.250", int port=1900, std::chrono::steady_clock::duration timeout=std::chrono::seconds(5)) const override
Function that sends a multicast request with the specified message.
Definition: WinHttpHandler.cpp:175
~WinHttpHandler()
Dtor needed for wsaData cleanup.
Definition: WinHttpHandler.cpp:70
WinHttpHandler()
Ctor needed for initializing wsaData.
Definition: WinHttpHandler.cpp:59
Base class for classes that handle http requests and multicast requests.
Definition: BaseHttpHandler.h:38
Class to handle http requests and multicast requests on windows systems.
Definition: WinHttpHandler.h:36
std::string send(const std::string &msg, const std::string &adr, int port=80) const override
Function that sends a given message to the specified host and returns the response.
Definition: WinHttpHandler.cpp:75