You're going about it the wrong way. The readBufferSize property controls the internal (read) buffer of the QTcpSocket. You don't need to touch it at all. Just read whatever is you want to read directly from the socket. If you want to make your life easier you can also make use of QDataStream and its transactions (assuming you're talking to a Qt application on the other side).
control socket states like: free (buffer size is NULL), busy (buffer size is not NULL) and readyForReading (buffer is full, it emits signal itself)
This makes no sense at all. Qt will asynchronously populate the socket object's buffer, so it's never "busy" or "free".
@silau It looks good but ldd doesn't always report exactly what is actually happening when you run your exe. It's a good start though. If you really wanted to trace it further you would have to ldd on each of those libs to see what they link. One of them could be using the 5.6 or whatever other version you may have. That being said I find that to be a bit unlikely though.
When I get a little bit of time later today I will run your code using Arch linux and 5.11 and see what happens. That will help determine if maybe it's a bug in Qt (which I highly doubt for something that big).
If it works for me the next steps for you would be to run it in the debugger and step through the working 5.6 one during socket connections and then the broken 5.11 one and see what is different.
Another option is take it down to the simplest form and just use the chat example or something from Qt and see if it works with 5.11 and then try to see what is different.
I'll let you know what I find out on my linux/Qt 5.11 in a bit.
Edit: Didn't get a chance today, was really busy. I will run a quick test tomorrow some time though.
Don't get this the wrong way, but are you coming from Java? I'm asking because this:
Doesn't make any sense in C++. What you probably want is to use the scope operator - :: to access one of the enum values. As for the error, please provide the full implementation of your TCP server and mention if you use threading, if so how. Also as mentioned by @koahnig
new QTcpSocket(new QObject());
This leaks 2 objects one socket and one generic QObject. You need to provide a valid pointer from the object tree to make use of the automatic deletion Qt supplies for child objects.
Hello i wish if i could help you. please i need to send voice over network using tcp socket and i believe you can help me if you give me your code (server and client side both )i will be very thankful.thank you soo much in advance.
OK, I use two sockets now.
On App A I have one socket for sending the broadcast message, and a second one on another port for receiving the answer.
Same on App B. One socket for receiving the broadcast message and a second one for sending the answer on a different port.
Still would be very happy if someone can find a solution for this using only one udp socket.