Pass listen port along to h3
This commit is contained in:
+4
-8
@@ -37,8 +37,7 @@ namespace uWS {
|
||||
if (!host.length()) {
|
||||
return listen(port, std::move(handler));
|
||||
}
|
||||
http3Context->listen();
|
||||
//handler(httpContext ? httpContext->listen(host.c_str(), port, 0) : nullptr);
|
||||
handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr);
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
@@ -47,22 +46,19 @@ namespace uWS {
|
||||
if (!host.length()) {
|
||||
return listen(port, options, std::move(handler));
|
||||
}
|
||||
http3Context->listen();
|
||||
//handler(httpContext ? httpContext->listen(host.c_str(), port, options) : nullptr);
|
||||
handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr);
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
/* Port, callback */
|
||||
H3App &&listen(int port, MoveOnlyFunction<void(us_listen_socket_t *)> &&handler) {
|
||||
http3Context->listen();
|
||||
//handler(httpContext ? httpContext->listen(nullptr, port, 0) : nullptr);
|
||||
handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr);
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
/* Port, options, callback */
|
||||
H3App &&listen(int port, int options, MoveOnlyFunction<void(us_listen_socket_t *)> &&handler) {
|
||||
http3Context->listen();
|
||||
//handler(http3Context ? http3Context->listen(nullptr, port, options) : nullptr);
|
||||
handler(http3Context ? (us_listen_socket_t *) http3Context->listen(port) : nullptr);
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -107,9 +107,9 @@ namespace uWS {
|
||||
// call init here after setting the ext to Http3ContextData
|
||||
}
|
||||
|
||||
us_quic_listen_socket_t *listen() {
|
||||
us_quic_listen_socket_t *listen(int port) {
|
||||
/* The listening socket is the actual UDP socket used */
|
||||
us_quic_listen_socket_t *listen_socket = us_quic_socket_context_listen((us_quic_socket_context_t *) this, "::", 9004, sizeof(Http3ResponseData));
|
||||
us_quic_listen_socket_t *listen_socket = us_quic_socket_context_listen((us_quic_socket_context_t *) this, "::", port, sizeof(Http3ResponseData));
|
||||
|
||||
//printf("Listen socket is: %p\n", listen_socket);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user