当前位置: 首页>>代码示例>>C++>>正文


C++ error_code::value方法代码示例

本文整理汇总了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);
	}
开发者ID:hicdre,项目名称:Adb,代码行数:7,代码来源:url_fetcher_impl.cpp

示例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());
}
开发者ID:keedongpark,项目名称:acton,代码行数:30,代码来源:session.cpp

示例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_);
    }
  }
开发者ID:barrbrain,项目名称:asio,代码行数:38,代码来源:win_iocp_handle_read_op.hpp


注:本文中的asio::error_code::value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。