本文整理汇总了C++中system::error_code::value方法的典型用法代码示例。如果您正苦于以下问题:C++ error_code::value方法的具体用法?C++ error_code::value怎么用?C++ error_code::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system::error_code
的用法示例。
在下文中一共展示了error_code::value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: would_block
bool basic_io_device::would_block(system::error_code const &e)
{
int code = e.value();
bool block = 0
#ifdef EAGAIN
|| code==EAGAIN
#endif
#ifdef EINPROGRESS
|| code == EINPROGRESS
#endif
#ifdef EWOULDBLOCK
|| code == EWOULDBLOCK
#endif
#ifdef WSAEAGAIN
|| code==WSAEAGAIN
#endif
#ifdef WSAEINPROGRESS
|| code == WSAEINPROGRESS
#endif
#ifdef WSAEWOULDBLOCK
|| code == WSAEWOULDBLOCK
#endif
;
return block;
}
示例2: handle_acceptSSL
void TcpServer::handle_acceptSSL(const system::error_code& error)
{
if(!acceptor_.is_open())
{
debug->warning(1, type, "TCP Socket, port %i - acceptor is not open!", port);
return;
}
if(!error)
new_ssl_connection->start();
else
debug->warning(1, type, "TCP Socket, port %i - error: %s, error code: %i", error.message().c_str(), error.value());
start_accept();
}
示例3: PrintError
void TcpClient::PrintError(const system::error_code& ec)
{
int error_code = ec.value();
switch(error_code)
{
case error::access_denied:
std::cout<<"error::access_denied"<<std::endl;
break;
case error::address_family_not_supported:
std::cout<<"error::address_family_not_supported"<<std::endl;
break;
case error::address_in_use:
std::cout<<"error::address_in_use"<<std::endl;
break;
case error::already_connected:
std::cout<<"error::already_connected "<<std::endl;
break;
case error::already_started:
std::cout<<"error::already_started "<<std::endl;
break;
case error::broken_pipe:
std::cout<<"error::broken_pipe "<<std::endl;
break;
case error::connection_aborted:
std::cout<<"error::connection_aborted "<<std::endl;
break;
case error::connection_refused:
std::cout<<"error::connection_refused "<<std::endl;
break;
case error::connection_reset:
std::cout<<"error::connection_reset "<<std::endl;
break;
case error::bad_descriptor:
std::cout<<"error::bad_descriptor "<<std::endl;
break;
case error::fault:
std::cout<<"error::fault "<<std::endl;
break;
case error::host_unreachable:
std::cout<<"error::host_unreachable "<<std::endl;
break;
case error::in_progress:
std::cout<<"error::in_progress "<<std::endl;
break;
case error::interrupted:
std::cout<<"error::interrupted "<<std::endl;
break;
case error::invalid_argument:
std::cout<<"error::invalid_argument "<<std::endl;
break;
case error::message_size:
std::cout<<"error::message_size "<<std::endl;
break;
case error::name_too_long:
std::cout<<"error::name_too_long "<<std::endl;
break;
case error::network_down:
std::cout<<"error::network_down "<<std::endl;
break;
case error::network_reset:
std::cout<<"error::network_reset "<<std::endl;
break;
case error::network_unreachable:
std::cout<<"error::network_unreachable "<<std::endl;
break;
case error::no_descriptors:
std::cout<<"error::no_descriptors "<<std::endl;
break;
case error::no_buffer_space:
std::cout<<"error::no_buffer_space "<<std::endl;
break;
case error::no_memory:
//.........这里部分代码省略.........
示例4: str
static std::string convert ( const system::error_code & ec )
{
return str ( format ( "%s (%i)" )
% ec.message ()
% ec.value () );
}