mercredi 5 septembre 2018

boost::asio async_receive_from not calling the handler

I am writing a simple UDP client that is going to listen (and sometimes send) to server, but my socket async_receive_from never calls the handler.

Here is my UDP client:


UdpClient.h

https://pastebin.com/vnuh6B52


UdpClient.cpp

https://pastebin.com/rsr7s1Sw


And the call is pretty straightworward:

_commClient = new UdpClient();
_commClient->Incoming.connect(boost::bind(&ShellController::MessageIn, this, _1));

var thr = std::thread(std::bind(&UdpClient::Init, reinterpret_cast<UdpClient *>(_commClient), true));
var thr2 = std::thread(std::bind(&UdpClient::Init, reinterpret_cast<UdpClient *>(_commClient), false));

I know I'm missing something, but I have no idea what could it be.

Aucun commentaire:

Enregistrer un commentaire