Skip to content

Commit 250d946

Browse files
committed
test
1 parent 1250c07 commit 250d946

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Test/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ void multithreadtest() {
127127
});
128128
listener.startlistening();
129129
std::vector<SL::WS_LITE::WSClient> clients;
130-
clients.reserve(50);
131-
for (auto i = 0; i < 50; i++) {
130+
clients.reserve(25);
131+
for (auto i = 0; i < 25; i++) {
132132
clients.push_back(SL::WS_LITE::WSClient::CreateClient(thrdcount));
133133
clients[i].onHttpUpgrade([&](const SL::WS_LITE::WSocket& socket) {
134134
lastheard = std::chrono::high_resolution_clock::now();

include/internal/WebSocketProtocol.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ namespace SL {
143143
class WSContext {
144144
public:
145145
WSContext(ThreadCount threadcount) :
146-
sslcontext(asio::ssl::context::tlsv11),
147-
work(std::make_unique<asio::io_service::work>(io_service)) {
146+
work(std::make_unique<asio::io_service::work>(io_service)) ,
147+
sslcontext(asio::ssl::context::tlsv11){
148148
Threads.resize(threadcount.value);
149149
for (auto& ctx : Threads) {
150150
inflateInit2(&ctx.inflationStream, -MAX_WBITS);
@@ -258,8 +258,9 @@ namespace SL {
258258

259259
WSListenerImpl(
260260
ThreadCount threadcount,
261-
PortNumber port) :
262-
acceptor(io_service, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port.value)), WSContext(threadcount) {
261+
PortNumber port) :
262+
WSContext(threadcount),
263+
acceptor(io_service, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port.value)){
263264

264265
}
265266

0 commit comments

Comments
 (0)