Skip to content

Commit ad6c78b

Browse files
asio: fix calling deprecated io_context methods (#255)
1 parent 8e533d7 commit ad6c78b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

SilKit/source/core/vasio/io/impl/AsioGenericRawByteStream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void AsioGenericRawByteStream::HandleShutdownOrError()
283283

284284
_shutdownPosted = true;
285285

286-
_asioIoContext->post([this] { _listener->OnShutdown(*this); });
286+
asio::post(*_asioIoContext, [this] { _listener->OnShutdown(*this); });
287287
}
288288
}
289289
}

SilKit/source/core/vasio/io/impl/AsioIoContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ void AsioIoContext::Run()
164164
void AsioIoContext::Post(std::function<void()> function)
165165
{
166166
SILKIT_TRACE_METHOD_(_logger, "(...)");
167-
_asioIoContext->post(std::move(function));
167+
asio::post(*_asioIoContext, std::move(function));
168168
}
169169

170170

171171
void AsioIoContext::Dispatch(std::function<void()> function)
172172
{
173173
SILKIT_TRACE_METHOD_(_logger, "(...)");
174-
_asioIoContext->dispatch(std::move(function));
174+
asio::dispatch(*_asioIoContext, std::move(function));
175175
}
176176

177177

docs/changelog/versions/latest.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# [5.0.2] - UNRELEASED
22

3-
> This changelog entry is still empty.
3+
## Fixed
4+
5+
- `asio`: replaced the deprecated (and now removed) methods `asio::io_context::post` and `asio::io_context::dispatch`
6+
with the suggested alternatives `asio::post` and `asio::dispatch`

0 commit comments

Comments
 (0)