简体   繁体   English

Boost ASIO TCP计时器客户端错误“解决:找不到指定的类”

[英]Boost ASIO TCP timer client error “resolve: The specified class is not found”

I am following Boost's TCP Timer tutorial here to learn TCP and UDP. 我正在关注Boost的TCP Timer教程以学习TCP和UDP。 I comment out the argc check, and change the following line: 我注释掉argc检查,并更改以下行:

tcp::resolver::query query(argv[1], "daytime");

into: 变成:

tcp::resolver::query query("127.0.0.1", "daytime");

Having the server code run on the same machine, I then ran the client code. 服务器代码在同一台计算机上运行,​​然后运行客户端代码。 This error is thrown: 引发此错误:

resolve: The specified class is not found

Using the debugger, the error comes from this line: 使用调试器,错误来自以下行:

tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);

which is right below the query declaration. 在查询声明的正下方。 Can someone point me to where the error comes from, and how to fix it? 有人可以指出错误的出处以及如何解决? Thanks. 谢谢。

Found the answer. 找到了答案。 The server code specified port number 13. I just need to change the line: 服务器代码指定了端口号13。我只需要更改以下行:

tcp::resolver::query query("127.0.0.1", "daytime");

into: 变成:

tcp::resolver::query query("127.0.0.1", "13");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM