exposed uws_app_close function from capi (#1667)

This commit is contained in:
Genrikh Fetischev
2023-10-17 20:50:17 +02:00
committed by GitHub
parent 143db3034f
commit 20b3ea4685
2 changed files with 18 additions and 3 deletions
+14
View File
@@ -408,6 +408,20 @@ extern "C"
uwsApp->domain(std::string(server_name, server_name_length));
}
}
void uws_app_close(int ssl, uws_app_t *app)
{
if (ssl)
{
uWS::SSLApp *uwsApp = (uWS::SSLApp *)app;
uwsApp->close();
}
else
{
uWS::App *uwsApp = (uWS::App *)app;
uwsApp->close();
}
}
void uws_app_destroy(int ssl, uws_app_t *app)
{
if (ssl)
+4 -3
View File
@@ -1,16 +1,16 @@
/*
* Copyright 2022 Ciro Spaciari
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -172,6 +172,7 @@ extern "C"
DLL_EXPORT void uws_app_listen_domain(int ssl, uws_app_t *app, const char *domain, size_t domain_length, uws_listen_domain_handler handler, void *user_data);
DLL_EXPORT void uws_app_listen_domain_with_options(int ssl, uws_app_t *app, const char *domain,size_t domain_length, int options, uws_listen_domain_handler handler, void *user_data);
DLL_EXPORT void uws_app_domain(int ssl, uws_app_t *app, const char* server_name, size_t server_name_length);
DLL_EXPORT void uws_app_close(int ssl, uws_app_t *app);
DLL_EXPORT bool uws_constructor_failed(int ssl, uws_app_t *app);
DLL_EXPORT unsigned int uws_num_subscribers(int ssl, uws_app_t *app, const char *topic, size_t topic_length);