Add getNativeHandle functions

This commit is contained in:
Alex Hultman
2020-06-20 23:36:27 +02:00
parent 030758c2a9
commit aac11b07fb
3 changed files with 11 additions and 1 deletions
+5
View File
@@ -38,6 +38,11 @@ private:
public:
/* Returns the SSL_CTX of this app, or nullptr. */
void *getNativeHandle() {
return us_socket_context_get_native_handle(SSL, (struct us_socket_context_t *) httpContext);
}
/* Attaches a "filter" function to track socket connections/disconnections */
void filter(fu2::unique_function<void(HttpResponse<SSL> *, int)> &&filterHandler) {
httpContext->filter(std::move(filterHandler));
+5
View File
@@ -35,6 +35,11 @@ struct AsyncSocket {
friend struct TopicTree;
protected:
/* Returns SSL pointer or FD as pointer */
void *getNativeHandle() {
return us_socket_get_native_handle(SSL, (us_socket_t *) this);
}
/* Get loop data for socket */
LoopData *getLoopData() {
return (LoopData *) us_loop_ext(us_socket_context_loop(SSL, us_socket_context(SSL, (us_socket_t *) this)));