boost::asio::ip::tcp::iostream stream;
stream.expires_from_now(boost::posix_time::seconds(60));
stream.connect("sitename","http");
SOME REQUeST
stream.flush();
///////////////// New request to the different site
stream.connect("another site","http");
somthink here
stream.flush();
我想我需要关闭连接,但我不知道该怎么做。
答案 0 :(得分:0)
您正在寻找流对象的成员函数.close ()
,关闭流后,您可以自由地将其连接到其他位置。
stream.close ();