We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
std::unique_ptr
1 parent 8275d18 commit 1572b27Copy full SHA for 1572b27
2 files changed
src/Context.cpp
@@ -17,9 +17,6 @@ void Context::init()
17
OVERLAPPED::OffsetHigh = 0;
18
19
_contextType = ContextType::None;
20
-
21
- if (acceptSocket == nullptr)
22
- acceptSocket = std::make_unique<Socket>(Protocol::Tcp);
23
}
24
25
Context::~Context()
src/Socket.cpp
@@ -134,6 +134,9 @@ bool Socket::accept(Context *context) const {
134
context->init();
135
136
context->_contextType = ContextType::Accept;
137
+ if (context->acceptSocket == nullptr)
138
+ context->acceptSocket = std::make_unique<Socket>(Protocol::Tcp);
139
+
140
ioSystem.push(context->acceptSocket->_sock);
141
142
DWORD dwByte = 0;
0 commit comments