>> std::string datos=buf.data();
>> rxint=boost::lexical_cast(datos); //(here is the problem)
 
Is the data in buf nul char terminated? Is the numeric data actually numeric and not something else?
 
Cliff