Feature / Adopt externally accepted sockets into uWebSockets. (#1697)
* Adopt externally accepted sockets into uWebSockets. * Integrate uSockets typo. --------- Co-authored-by: markus <[email protected]>
This commit is contained in:
@@ -575,6 +575,12 @@ public:
|
|||||||
return std::move(*this);
|
return std::move(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* adopt an externally accepted socket */
|
||||||
|
TemplatedApp &&adoptSocket(LIBUS_SOCKET_DESCRIPTOR accepted_fd) {
|
||||||
|
httpContext->adoptAcceptedSocket(accepted_fd);
|
||||||
|
return std::move(*this);
|
||||||
|
}
|
||||||
|
|
||||||
TemplatedApp &&run() {
|
TemplatedApp &&run() {
|
||||||
uWS::run();
|
uWS::run();
|
||||||
return std::move(*this);
|
return std::move(*this);
|
||||||
|
|||||||
@@ -482,6 +482,11 @@ public:
|
|||||||
us_listen_socket_t *listen(const char *path, int options) {
|
us_listen_socket_t *listen(const char *path, int options) {
|
||||||
return us_socket_context_listen_unix(SSL, getSocketContext(), path, options, sizeof(HttpResponseData<SSL>));
|
return us_socket_context_listen_unix(SSL, getSocketContext(), path, options, sizeof(HttpResponseData<SSL>));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Adopt an externally accepted socket into this HttpContext */
|
||||||
|
us_socket_t *adoptAcceptedSocket(LIBUS_SOCKET_DESCRIPTOR accepted_fd) {
|
||||||
|
return us_adopt_accepted_socket(SSL, getSocketContext(), accepted_fd, sizeof(HttpResponseData<SSL>), 0, 0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
Submodule uSockets updated: a15d9bbdea...07654e4fb9
Reference in New Issue
Block a user