0
try
{
boost::asio::io_service io_service;
tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 13));
for (;;)
{
tcp::socket socket(io_service);
acceptor.accept(socket);
//how do i make a checker here if the client is not sending anything then server send or if the client sending then server recive
}
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
}
我如何做一個檢查,如果客戶端不發送任何東西,然後服務器發送或者客戶端然後發送服務器recive的boost :: ASIO檢查
這個問題不清楚。這聽起來像你想要一個協議,例如:如果客戶端在't'秒內沒有發送'n'字節,服務器會斷開客戶端? – 2011-05-18 17:09:37