Boost logo

Boost Users :

Subject: Re: [Boost-users] async_send handler problem
From: Alexander Carôt (Alexander_Carot_at_[hidden])
Date: 2013-12-16 14:23:26

>>void sender::sendIt(char *charBuffer){
>> sj->dFC->;
>You should not call io_service::run() inside this function. The normal
>pattern is to set up your network code, e.g. from main(), and then call
>run() after setup. This call will block (and all Asio callbacks will be
>executed from this thread.) If you do not want your main thread to
>handle the network code, then you can launch in a separate thread (as
>previously suggested.)

Yes, I truly understand this but for some weired reason this doesn't work
at all. In my case I launch the run function in the constructor of the
main class right after the sender class had been instantiated:


  dFC->mySender = new sender(this);

  boost::thread t =

  // OR dFC->;

In there anything wrong with this ?



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at