[否绑定&QUOT匹配功能进行呼叫;同时采用websocketpp [英] "No matching function for call to bind" while using websocketpp

查看:256
本文介绍了[否绑定&QUOT匹配功能进行呼叫;同时采用websocketpp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我作出(C ++)应用程序,它是一个WebSocket的客户端和服务器的WebSocket。为了能够,我使用的库websocketpp做到这一点。为了使应用程序既是客户机和服务器,我想在 endpoint1.run() endpoint2.listen(口)是多线程。这是不顺心的事。

I'm making an (c++) application which is a websocket client and websocket server. To be able to do this, I'm using the library websocketpp. To make the application both a client and server, I want the endpoint1.run() and endpoint2.listen(port) to be multi-threaded. This is where something goes wrong.

一般情况下(单线程)我使用: endpoint.listen(口); 其中工程

Normally (single thread) I use: endpoint.listen(port); which works.

要使它成为多线程的使用:

To make it into a multi-thread I use:

boost::thread t(boost::bind(&server::listen, &endpoint, port));
sleep(1);
cout << "After thread! \n";
t.join();

不过,我得到的错误:

However, I get the error:

main.cpp中:116:错误:调用没有匹配的函数'结合(小于未解决重载函数类型&gt;中websocketpp ::服务器*,uint16_t和放大器;)

服务器::听是一个重载函数,我应该说是在不同的绑定?

server::listen is an overloaded function, should I call it differently in bind?

推荐答案

看看的的提振文档。这是一个很好的例子。结果
您需要通过你的自我,以解决歧义。

Take a look at the boost documentation. There is a good example.
You need to resolve the ambiguity by your self.

这篇关于[否绑定&QUOT匹配功能进行呼叫;同时采用websocketpp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆