You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
647 B
C++
30 lines
647 B
C++
#ifndef WEBCC_SOCKET_H_
|
|
#define WEBCC_SOCKET_H_
|
|
|
|
#include "webcc/socket_base.h"
|
|
|
|
namespace webcc {
|
|
|
|
class Socket : public SocketBase {
|
|
public:
|
|
explicit Socket(boost::asio::io_context& io_context);
|
|
|
|
void AsyncConnect(const std::string& host, const Endpoints& endpoints,
|
|
ConnectHandler&& handler) override;
|
|
|
|
void AsyncWrite(const Payload& payload, WriteHandler&& handler) override;
|
|
|
|
void AsyncReadSome(ReadHandler&& handler, std::vector<char>* buffer) override;
|
|
|
|
bool Shutdown() override;
|
|
|
|
bool Close() override;
|
|
|
|
private:
|
|
boost::asio::ip::tcp::socket socket_;
|
|
};
|
|
|
|
} // namespace webcc
|
|
|
|
#endif // WEBCC_SOCKET_H_
|