Boost ASIO 连接失败

Boost ASIO connect failing

我想使用 boost asio 做一个简单的 C++ web get

我开始以这个为例http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/example/ssl/client.cpp

但我不断收到这样的消息

Connect failed: No connection could be made because the target machine actively refused it

这很尴尬,问题是主机名中的拼写错误。当引用无效的主机名时,您会收到此错误消息:

No connection could be made because the target machine actively refused it

把这个答案放在这里以防其他人遇到同样的愚蠢错误