データの送受信を同時に行えるTCPクライアントを作成しています。別々のスレッドasync_send
で、どのように呼び出すべきか教えていただけますか?async_receive
言い換えれば、どのように呼び出すか
m_Socket.async_send(boost::asio::buffer(txBuf.c_str(), txBuf.length()+1),
boost::bind(&TCPClient::sendingHandler, this, boost::asio::placeholders::error));
m_Socket.async_receive(boost::asio::buffer(rxBuf, maxBufLen),
boost::bind(&TCPClient::sendingHandler, this, boost::asio::placeholders::error));
の
boost::thread receivingThread(boost::bind(...));
boost::thread sendingThread(boost::bind(...));
また、ハンドラー内で呼び出したり、再度呼び出しasync_send
たりすると、正しく機能しますか?async_receive
データを送受信するための不定詞ループが必要です。