C
C
c4boomb2015-01-06 00:21:25
Qt
c4boomb, 2015-01-06 00:21:25

Server response divided by spaces (Qt c++). How to send whole?

QTcp Server. telnet client.
I send a message like this:

string message;
cin>>message;
message.append("\n\r");
QByteArray sMessage(message.c_str(), message.length());
socket->write(sMessage);
socket->waitForBytesWritten(3000);

Word by word comes. How to send a whole message? Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tsarevfs, 2015-01-06
@c4boomb

cin>>message only reads up to a space.
use www.cplusplus.com/reference/string/string/getline

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question