Skip to content

Commit dfe95ff

Browse files
committed
From now on, disable dynamic thread pool groups and networking
support by default. This support will be removed sometime in 2025.
1 parent c032616 commit dfe95ff

File tree

9 files changed

+43
-8
lines changed

9 files changed

+43
-8
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ option(LLFIO_ENABLE_DEPENDENCY_SMOKE_TEST "Whether to build executables which ar
4444
option(LLFIO_ASSUME_CROSS_COMPILING "Whether to assume we are cross compiling. Normally automatically detected, but if automatic detection doesn't work, a working <filesystem> will not be found during cmake configure." OFF)
4545
option(LLFIO_FORCE_CONCEPTS_OFF "Whether to not auto detect and enable concepts for the LLFIO cmake targets" OFF)
4646
option(LLFIO_FORCE_COROUTINES_OFF "Whether to not auto detect and enable coroutines for the LLFIO cmake targets" OFF)
47-
option(LLFIO_FORCE_DYNAMIC_THREAD_POOL_GROUP_OFF "Whether to disable dynamic thread pool support in LLFIO" OFF)
48-
option(LLFIO_FORCE_NETWORKING_OFF "Whether to disable networking support in LLFIO" OFF)
47+
option(LLFIO_FORCE_DYNAMIC_THREAD_POOL_GROUP_OFF "Whether to disable dynamic thread pool support in LLFIO" ON)
48+
option(LLFIO_FORCE_NETWORKING_OFF "Whether to disable networking support in LLFIO" ON)
4949
option(LLFIO_FORCE_MAPPED_FILES_OFF "Whether to disable memory mapped files support in LLFIO" OFF)
50-
option(LLFIO_FORCE_OPENSSL_OFF "Whether to disable use of OpenSSL in LLFIO" OFF)
50+
option(LLFIO_FORCE_OPENSSL_OFF "Whether to disable use of OpenSSL in LLFIO" ON)
5151
option(LLFIO_FORCE_SIGNAL_DETECTION_OFF "Whether to disable detection of signal raises in LLFIO" OFF)
5252
option(UNIT_TESTS_BUILD_ALL "Whether to run all of the unit test suite." OFF)
5353
set(UNIT_TESTS_CXX_VERSION "latest" CACHE STRING "The version of C++ to use in the header-only unit tests")

example/tls_socket_server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Distributed under the Boost Software License, Version 1.0.
3333
#pragma warning(disable: 4706) // assignment within conditional
3434
#endif
3535

36+
#ifndef LLFIO_EXCLUDE_NETWORKING
3637
void tls_socket_server()
3738
{
3839
//! [tls_socket_server]
@@ -184,6 +185,7 @@ void tls_socket_server()
184185
}
185186
//! [tls_socket_server]
186187
}
188+
#endif
187189

188190
int main()
189191
{

example/wrap_tls_socket.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Distributed under the Boost Software License, Version 1.0.
3333
#pragma warning(disable: 4706) // assignment within conditional
3434
#endif
3535

36+
#ifndef LLFIO_EXCLUDE_NETWORKING
3637
void wrap_tls_socket()
3738
{
3839
//! [wrap_tls_socket]
@@ -73,6 +74,7 @@ void wrap_tls_socket()
7374

7475
//! [wrap_tls_socket]
7576
}
77+
#endif
7678

7779
int main()
7880
{

include/llfio/revision.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
2-
#define LLFIO_PREVIOUS_COMMIT_REF 3ebfc74763d7a5048bbe0719472190efce4cda85
3-
#define LLFIO_PREVIOUS_COMMIT_DATE "2024-07-30 13:20:31 +00:00"
4-
#define LLFIO_PREVIOUS_COMMIT_UNIQUE 3ebfc747
2+
#define LLFIO_PREVIOUS_COMMIT_REF c0326169a2f9577d617f38dd039df21f7492a548
3+
#define LLFIO_PREVIOUS_COMMIT_DATE "2024-08-18 12:32:44 +00:00"
4+
#define LLFIO_PREVIOUS_COMMIT_UNIQUE c0326169

include/llfio/v2.0/byte_socket_handle.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Distributed under the Boost Software License, Version 1.0.
2525
#ifndef LLFIO_BYTE_SOCKET_HANDLE_H
2626
#define LLFIO_BYTE_SOCKET_HANDLE_H
2727

28+
#ifndef LLFIO_DISABLE_DEPRECATION_WARNINGS
29+
#warning "Networking support is deprecated and scheduled for removal soon"
30+
#endif
31+
2832
#include "byte_io_handle.hpp"
2933

3034
struct sockaddr;

include/llfio/v2.0/dynamic_thread_pool_group.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Distributed under the Boost Software License, Version 1.0.
2525
#ifndef LLFIO_DYNAMIC_THREAD_POOL_GROUP_H
2626
#define LLFIO_DYNAMIC_THREAD_POOL_GROUP_H
2727

28+
#ifndef LLFIO_DISABLE_DEPRECATION_WARNINGS
29+
#warning "Dynamic thread pool groups are deprecated and scheduled for removal soon"
30+
#endif
31+
2832
#include "deadline.h"
2933

3034
#include <memory> // for unique_ptr and shared_ptr
@@ -185,6 +189,7 @@ implementation).
185189
class LLFIO_DECL dynamic_thread_pool_group
186190
{
187191
friend class dynamic_thread_pool_group_impl;
192+
188193
public:
189194
//! An individual item of work within the work group.
190195
class work_item

test/tests/byte_socket_handle.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Distributed under the Boost Software License, Version 1.0.
2929

3030
static inline void TestSocketAddress()
3131
{
32+
#ifndef LLFIO_EXCLUDE_NETWORKING
3233
namespace llfio = LLFIO_V2_NAMESPACE;
3334
{
3435
auto a = llfio::ip::address_v4::loopback();
@@ -267,10 +268,12 @@ static inline void TestSocketAddress()
267268
std::cout << ss.str() << std::endl;
268269
BOOST_CHECK(ss.str() == "[1000::]:1234");
269270
}
271+
#endif
270272
}
271273

272274
static inline void TestSocketResolve()
273275
{
276+
#ifndef LLFIO_EXCLUDE_NETWORKING
274277
namespace llfio = LLFIO_V2_NAMESPACE;
275278
static const llfio::string_view addrs[] = {"google.com", "youtube.com", "tmall.com", "qq.com", "baidu.com",
276279
"sohu.com", "facebook.com", "taobao.com", "amazon.com", "www.nedprod.com"};
@@ -370,10 +373,12 @@ static inline void TestSocketResolve()
370373
}
371374
}
372375
resolvers.clear();
376+
#endif
373377
}
374378

375379
static inline void TestBlockingSocketHandles()
376380
{
381+
#ifndef LLFIO_EXCLUDE_NETWORKING
377382
namespace llfio = LLFIO_V2_NAMESPACE;
378383
auto serversocket =
379384
llfio::listening_byte_socket_handle::listening_byte_socket(llfio::ip::family::v4, llfio::listening_byte_socket_handle::mode::read).value();
@@ -436,10 +441,12 @@ static inline void TestBlockingSocketHandles()
436441
BOOST_REQUIRE(written == 5);
437442
writer.shutdown_and_close().value();
438443
readerthread.get();
444+
#endif
439445
}
440446

441447
static inline void TestNonBlockingSocketHandles()
442448
{
449+
#ifndef LLFIO_EXCLUDE_NETWORKING
443450
namespace llfio = LLFIO_V2_NAMESPACE;
444451
auto serversocket =
445452
llfio::listening_byte_socket_handle::listening_byte_socket(llfio::ip::family::v4, llfio::listening_byte_socket_handle::mode::read,
@@ -504,9 +511,11 @@ static inline void TestNonBlockingSocketHandles()
504511
writer.shutdown_and_close().value(); // must not block nor fail
505512
writer.close().value();
506513
reader.first.close().value();
514+
#endif
507515
}
508516

509517
#if LLFIO_ENABLE_TEST_IO_MULTIPLEXERS
518+
#ifndef LLFIO_EXCLUDE_NETWORKING
510519
static inline void TestMultiplexedSocketHandles()
511520
{
512521
static constexpr size_t MAX_SOCKETS = 64;
@@ -827,9 +836,11 @@ static inline void TestCoroutinedSocketHandles()
827836
}
828837
#endif
829838
#endif
839+
#endif
830840

831841
static inline void TestPollingSocketHandles()
832842
{
843+
#ifndef LLFIO_EXCLUDE_NETWORKING
833844
static constexpr size_t MAX_SOCKETS = 64;
834845
namespace llfio = LLFIO_V2_NAMESPACE;
835846
std::vector<std::pair<llfio::listening_byte_socket_handle, llfio::ip::address>> listening;
@@ -987,6 +998,7 @@ static inline void TestPollingSocketHandles()
987998
connect_task.get();
988999
poll_listening_task.get();
9891000
poll_connecting_task.get();
1001+
#endif
9901002
}
9911003

9921004
KERNELTEST_TEST_KERNEL(integration, llfio, ip, address, "Tests that llfio::ip::address works as expected", TestSocketAddress())

test/tests/tls_socket_handle.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Distributed under the Boost Software License, Version 1.0.
2828

2929
static inline void TestBlockingTLSSocketHandles()
3030
{
31+
#ifndef LLFIO_EXCLUDE_NETWORKING
3132
namespace llfio = LLFIO_V2_NAMESPACE;
3233
if(llfio::tls_socket_source_registry::empty())
3334
{
@@ -136,8 +137,10 @@ static inline void TestBlockingTLSSocketHandles()
136137
auto rawserversocket = llfio::listening_byte_socket_handle::listening_byte_socket(llfio::ip::family::v4).value();
137138
auto rawwriter = llfio::byte_socket_handle::byte_socket(llfio::ip::family::v4).value();
138139
runtest(tls_socket_source->wrap(&rawserversocket).value(), tls_socket_source->wrap(&rawwriter).value());
140+
#endif
139141
}
140142

143+
#ifndef LLFIO_EXCLUDE_NETWORKING
141144
struct TestNonBlockingTLSSocketHandlesRunTest
142145
{
143146
template <class F> TestNonBlockingTLSSocketHandlesRunTest(LLFIO_V2_NAMESPACE::listening_tls_socket_handle_ptr serversocket, F &&make_writer)
@@ -258,8 +261,10 @@ struct TestNonBlockingTLSSocketHandlesRunTest
258261
reader.first->close().value();
259262
}
260263
};
264+
#endif
261265
static inline void TestNonBlockingTLSSocketHandles()
262266
{
267+
#ifndef LLFIO_EXCLUDE_NETWORKING
263268
namespace llfio = LLFIO_V2_NAMESPACE;
264269
if(llfio::tls_socket_source_registry::empty())
265270
{
@@ -275,13 +280,15 @@ static inline void TestNonBlockingTLSSocketHandles()
275280
auto rawserversocket = llfio::listening_byte_socket_handle::multiplexable_listening_byte_socket(llfio::ip::family::v4).value();
276281
auto rawwriter = llfio::byte_socket_handle::multiplexable_byte_socket(llfio::ip::family::v4).value();
277282
TestNonBlockingTLSSocketHandlesRunTest(tls_socket_source->wrap(&rawserversocket).value(), [&] { return tls_socket_source->wrap(&rawwriter).value(); });
283+
#endif
278284
}
279285

280286
/* This test makes the assumption that the host OS is able to validate github.com's
281287
TLS certificate.
282288
*/
283289
static inline void TestAuthenticatingTLSSocketHandles()
284290
{
291+
#ifndef LLFIO_EXCLUDE_NETWORKING
285292
//! [https_get]
286293
namespace llfio = LLFIO_V2_NAMESPACE;
287294
static constexpr llfio::string_view test_host("github.com");
@@ -331,7 +338,8 @@ static inline void TestAuthenticatingTLSSocketHandles()
331338
<< std::endl;
332339
// Make sure this doesn't hang because the socket is closed
333340
sock->shutdown_and_close().value();
334-
//! [https_get]
341+
//! [https_get]
342+
#endif
335343
}
336344

337345
#if 0
@@ -656,6 +664,7 @@ static inline void TestCoroutinedTLSSocketHandles()
656664

657665
static inline void TestPollingTLSSocketHandles()
658666
{
667+
#ifndef LLFIO_EXCLUDE_NETWORKING
659668
static constexpr size_t MAX_SOCKETS = 64;
660669
namespace llfio = LLFIO_V2_NAMESPACE;
661670
if(llfio::tls_socket_source_registry::empty())
@@ -843,6 +852,7 @@ static inline void TestPollingTLSSocketHandles()
843852
}
844853
runtest([&](size_t idx) { return tls_socket_source->wrap(&rawlisteners[idx]).value(); },
845854
[&](size_t idx) { return tls_socket_source->wrap(&rawwriters[idx]).value(); });
855+
#endif
846856
}
847857

848858
KERNELTEST_TEST_KERNEL(integration, llfio, tls_socket_handle, blocking, "Tests that blocking llfio::tls_byte_socket_handle works as expected",

0 commit comments

Comments
 (0)