#ifndef WEBSOCKETCLIENTWITHPOOL_H
|
#define WEBSOCKETCLIENTWITHPOOL_H
|
|
//#include "WebSocketClient.h"
|
//#include "ThreadPool.h"
|
//
|
//class WebSocketClientPool {
|
//public:
|
// explicit WebSocketClientPool(size_t thread_count);
|
// ~WebSocketClientPool();
|
//
|
// // ³õʼ»¯¿Í»§¶Ë
|
// void init_clients(const std::vector<std::string>& uris);
|
//
|
// // Í˳öËùÓпͻ§¶Ë
|
// void exit_clients();
|
//
|
// // ʹÓÃÏ̳߳ط¢ËÍÏûÏ¢
|
// void post_to_all(const std::string& message);
|
// void post_binary_to_all(const std::vector<char>& binary_data);
|
//
|
// // ´Ó³ØÖÐÑ¡ÔñÒ»¸ö¿ÕÏеĿͻ§¶Ë½øÐз¢ËÍ£¬²»ÐèÒª·þÎñÆ÷ÏìÓ¦
|
// bool post_to_idle_client(const std::string& message);
|
// bool post_binary_to_idle_client(const std::vector<char>& binary_data);
|
//
|
// // ´Ó³ØÖÐÑ¡ÔñÒ»¸ö¿ÕÏеĿͻ§¶Ë½øÐз¢ËÍ£¬²¢ÐèÒª·þÎñÆ÷ÏìÓ¦
|
// bool send_to_idle_client(const std::string& message, int timeout_ms);
|
// bool send_binary_to_idle_client(const std::vector<char>& binary_data, int timeout_ms);
|
//
|
// // ´Ó³ØÖÐÑ¡ÔñÒ»¸ö¿ÕÏеĿͻ§¶Ë½øÐз¢ËÍ£¬²¢µÈ´ý·þÎñÆ÷ÏìÓ¦
|
// bool send_to_idle_client_and_wait(const std::string& message, int timeout_ms);
|
// bool send_binary_to_idle_client_and_wait(const std::vector<char>& binary_data, int timeout_ms);
|
//
|
// // ´Ó³ØÖÐÑ¡ÔñÒ»¸ö¿ÕÏеĿͻ§¶Ë½øÐз¢ËÍ£¬²¢µÈ´ý·þÎñÆ÷ÏìÓ¦£¬Èç¹û³¬Ê±ÔòÖØÊÔ
|
// bool send_to_idle_client_with_retry(const std::string& message, int total_timeout_ms, int retry_interval_ms);
|
// bool send_binary_to_idle_client_with_retry(std::vector<char>&& binary_data, int total_timeout_ms, int retry_interval_ms);
|
//
|
// // ÉèÖà WebSocket ¿Í»§¶Ëʼþ´¦Àí³ÌÐò
|
// void set_open_handler(WebSocketClient::OpenHandler handler);
|
// void set_message_handler(WebSocketClient::MessageHandler handler);
|
// void set_close_handler(WebSocketClient::CloseHandler handler);
|
// void set_fail_handler(WebSocketClient::FailHandler handler);
|
// void set_pong_handler(WebSocketClient::PongHandler handler);
|
//
|
//private:
|
// std::vector<std::shared_ptr<WebSocketClient>> m_clients;
|
// ThreadPool m_thread_pool;
|
//};
|
|
#endif // WEBSOCKETCLIENTWITHPOOL_H
|