本文整理汇总了C++中asio::error_code::value方法的典型用法代码示例。如果您正苦于以下问题:C++ error_code::value方法的具体用法?C++ error_code::value怎么用?C++ error_code::value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asio::error_code
的用法示例。
在下文中一共展示了error_code::value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnError
void URLFetcherImpl::OnError(HttpRequestJob* job, const asio::error_code& err)
{
status_.set_status(URLRequestStatus::FAILED);
status_.set_error(err.value());
if (delegate_)
delegate_->OnURLFetchComplete(this);
}
示例2: onConnectCompleted
void Connection::onConnectCompleted(const asio::error_code& err)
{
UInt32 result = 1;
if ( !err )
{
result = 0;
}
EventRawConnected* e = new EventRawConnected;
e->idx = GetUniqueId();
e->result = result;
e->socketIndex = GetSessionId();
e->key = 0;
m_net->Notify( EventPtr( e ) );
if ( !err )
{
requestRecv();
}
else
{
// 에러 날 경우 연결 종료도 통보함
onError( err );
}
MU2LogSystem( 0, "Connection::Error> [Code: %d]", err.value());
}
示例3: do_complete
static void do_complete(io_service_impl* owner, operation* base,
asio::error_code ec, std::size_t bytes_transferred)
{
// Take ownership of the operation object.
win_iocp_handle_read_op* o(static_cast<win_iocp_handle_read_op*>(base));
ptr p = { boost::addressof(o->handler_), o, o };
#if defined(ASIO_ENABLE_BUFFER_DEBUGGING)
if (owner)
{
// Check whether buffers are still valid.
buffer_sequence_adapter<asio::mutable_buffer,
MutableBufferSequence>::validate(o->buffers_);
}
#endif // defined(ASIO_ENABLE_BUFFER_DEBUGGING)
// Map non-portable errors to their portable counterparts.
if (ec.value() == ERROR_HANDLE_EOF)
ec = asio::error::eof;
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
// sub-object of the handler may be the true owner of the memory associated
// with the handler. Consequently, a local copy of the handler is required
// to ensure that any owning sub-object remains valid until after we have
// deallocated the memory here.
detail::binder2<Handler, asio::error_code, std::size_t>
handler(o->handler_, ec, bytes_transferred);
p.h = boost::addressof(handler.handler_);
p.reset();
// Make the upcall if required.
if (owner)
{
asio::detail::fenced_block b;
asio_handler_invoke_helpers::invoke(handler, handler.handler_);
}
}