|
|
@@ -4279,14 +4279,25 @@ public:
|
|
|
bool is_open() const;
|
|
|
const std::string &subprotocol() const;
|
|
|
void set_read_timeout(time_t sec, time_t usec = 0);
|
|
|
+ template <class Rep, class Period>
|
|
|
+ void set_read_timeout(const std::chrono::duration<Rep, Period> &duration);
|
|
|
+
|
|
|
void set_write_timeout(time_t sec, time_t usec = 0);
|
|
|
+ template <class Rep, class Period>
|
|
|
+ void set_write_timeout(const std::chrono::duration<Rep, Period> &duration);
|
|
|
+
|
|
|
void set_websocket_ping_interval(time_t sec);
|
|
|
void set_websocket_max_missed_pongs(int count);
|
|
|
void set_tcp_nodelay(bool on);
|
|
|
void set_address_family(int family);
|
|
|
void set_ipv6_v6only(bool on);
|
|
|
void set_socket_options(SocketOptions socket_options);
|
|
|
+
|
|
|
void set_connection_timeout(time_t sec, time_t usec = 0);
|
|
|
+ template <class Rep, class Period>
|
|
|
+ void
|
|
|
+ set_connection_timeout(const std::chrono::duration<Rep, Period> &duration);
|
|
|
+
|
|
|
void set_interface(const std::string &intf);
|
|
|
void set_hostname_addr_map(std::map<std::string, std::string> addr_map);
|
|
|
|
|
|
@@ -4342,6 +4353,28 @@ private:
|
|
|
#endif
|
|
|
};
|
|
|
|
|
|
+template <class Rep, class Period>
|
|
|
+inline void WebSocketClient::set_read_timeout(
|
|
|
+ const std::chrono::duration<Rep, Period> &duration) {
|
|
|
+ detail::duration_to_sec_and_usec(
|
|
|
+ duration, [&](time_t sec, time_t usec) { set_read_timeout(sec, usec); });
|
|
|
+}
|
|
|
+
|
|
|
+template <class Rep, class Period>
|
|
|
+inline void WebSocketClient::set_write_timeout(
|
|
|
+ const std::chrono::duration<Rep, Period> &duration) {
|
|
|
+ detail::duration_to_sec_and_usec(
|
|
|
+ duration, [&](time_t sec, time_t usec) { set_write_timeout(sec, usec); });
|
|
|
+}
|
|
|
+
|
|
|
+template <class Rep, class Period>
|
|
|
+inline void WebSocketClient::set_connection_timeout(
|
|
|
+ const std::chrono::duration<Rep, Period> &duration) {
|
|
|
+ detail::duration_to_sec_and_usec(duration, [&](time_t sec, time_t usec) {
|
|
|
+ set_connection_timeout(sec, usec);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
namespace impl {
|
|
|
|
|
|
bool is_valid_utf8(const std::string &s);
|