-1
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();

我想我需要关闭连接,但我不知道该怎么做。

4

1 回答 1

0

您正在寻找.close ()流对象的成员函数,关闭流后,您可以自由地将其连接到其他地方。

stream.close ();

文档:

于 2012-07-15T12:11:51.597 回答