13 #ifndef __LIBEVENT_SSL_SOCKET_HPP__ 14 #define __LIBEVENT_SSL_SOCKET_HPP__ 16 #include <event2/buffer.h> 17 #include <event2/bufferevent_ssl.h> 18 #include <event2/event.h> 19 #include <event2/listener.h> 20 #include <event2/util.h> 46 const openssl::TLSClientConfig& config)
override;
79 evconnlistener* _listener,
81 : peek_event(
nullptr),
87 evconnlistener* listener;
94 RecvRequest(
char* _data,
size_t _size)
95 : data(_data),
size(_size) {}
103 SendRequest(
size_t _size)
109 struct ConnectRequest
125 void accept_callback(AcceptRequest*
request);
129 static void accept_SSL_callback(AcceptRequest* request);
134 static void peek_callback(evutil_socket_t fd,
short what,
void* arg);
141 static void recv_callback(bufferevent* bev,
void* arg);
142 void recv_callback();
144 static void send_callback(bufferevent* bev,
void* arg);
145 void send_callback();
147 static void event_callback(bufferevent* bev,
short events,
void* arg);
148 void event_callback(
short events);
152 evconnlistener* listener;
155 std::atomic_flag lock = ATOMIC_FLAG_INIT;
163 bool received_eof =
false;
184 std::weak_ptr<LibeventSSLSocketImpl>* event_loop_handle;
201 #endif // __LIBEVENT_SSL_SOCKET_HPP__
Try< Bytes > size(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:130
Future< Response > request(const Request &request, bool streamedResponse=false)
Asynchronously sends an HTTP request to the process and returns the HTTP response once the entire res...
LibeventSSLSocketImpl(int_fd _s)
int_fd s
Definition: socket.hpp:246
Kind
Available kinds of implementations.
Definition: socket.hpp:67
Future< std::shared_ptr< SocketImpl > > accept() override
Returns an implementation corresponding to the next pending connection for the listening socket...
Future< Nothing > connect(const Address &address) override
static Try< std::shared_ptr< SocketImpl > > create(int_fd s)
Definition: address.hpp:324
Try< Nothing > listen(int backlog) override
Try< Address > address() const
Returns the Address with the assigned ip and assigned port.
SocketImpl::Kind kind() const override
Definition: libevent_ssl_socket.hpp:54
Implementation interface for a Socket.
Definition: socket.hpp:58
Definition: future.hpp:74
Protocol< PromiseRequest, PromiseResponse > promise
~LibeventSSLSocketImpl() override
Definition: attributes.hpp:24
Definition: executor.hpp:48
Definition: libevent_ssl_socket.hpp:32
Future< size_t > sendfile(int_fd fd, off_t offset, size_t size) override
Try< Netlink< struct nl_sock > > socket(int protocol=NETLINK_ROUTE)
Definition: internal.hpp:91
int int_fd
Definition: int_fd.hpp:35
Future< size_t > send(const char *data, size_t size) override
Try< Nothing, SocketError > shutdown(int how) override
Shuts down the socket.
Future< size_t > recv(char *data, size_t size) override