10 Feb
2010
10 Feb
'10
12:48 p.m.
char *datos3="UNBLOCK"; size_t len2 = socket.read_some(boost::asio::buffer(buf2), error2);
datos2=(buf2.data());
//and compare datos2 and datos3
ost::is_equal test;
if (test(datos2,datos3)) { std::cout << "Equal" << endl; return; } else std::cout << "NO Equal" << endl;
but the string in Datos2 is : UNBLOCK@ = ��< , what i got that strange charateres?
Are you sure that you get from the socket null-terminated sequence of characters? If it's not null-terminated, then set null-terminator manually - or just do not use functions that expect null-terminated strings.