1.配置默认使用v3。2.asio中文转u8。3.com*hpp添加一个trim功能。
This commit is contained in:
		
							parent
							
								
									f99b2cbabb
								
							
						
					
					
						commit
						2847a88525
					
				
							
								
								
									
										15
									
								
								server.cxx
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								server.cxx
									
									
									
									
									
								
							@ -14,6 +14,15 @@ Server::~Server()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Server::print_exception(const std::exception& e)
 | 
			
		||||
{
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
    std::cerr << ansi_to_u8(e.what()) << '\n';
 | 
			
		||||
#else
 | 
			
		||||
    std::cerr << e.what() << '\n';
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Server::start()
 | 
			
		||||
{
 | 
			
		||||
    asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port_);
 | 
			
		||||
@ -24,11 +33,7 @@ void Server::start()
 | 
			
		||||
        acceptor_.listen();
 | 
			
		||||
        do_accept();
 | 
			
		||||
    } catch (const std::exception& e) {
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
        std::cerr << ansi_to_u8(e.what()) << '\n';
 | 
			
		||||
#else
 | 
			
		||||
        std::cerr << e.what() << '\n';
 | 
			
		||||
#endif
 | 
			
		||||
        print_exception(e);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user