$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [ASIO] serial_port read seems to lost packets
From: Daniele Barzotti (daniele.barzotti_at_[hidden])
Date: 2009-04-10 02:53:42
Igor R ha scritto:
>> void SerialPort::read_complete(const boost::system::error_code& error,
>> size_t bytes_transferred)
>> {
>>  // the asynchronous read operation has now completed
>>  if (!error)
>>  {
>>    // saving data to vector
>>    _read_buffer.append(_buf, bytes_transferred);
>>   cout << _read_buffer << endl;
>>  }
>>  // start waiting for another asynchronous read again
>>  read_start();
>> };
> 
> What if you move "if (!error)" condition down and put it before read_start()?
> 
Hi Igor!
I didn't think! Now it seems to work!!
Thanks again.
Cheers,
Daniele.