Multiple sockets Read and Write.
I want to open two sockets and Read data from one socket and write data on the other in accordance with the read data.
Scenario Read data from socket 1 and write some data on to Socket 2 in parallel and wait for ack from socket 2 and then again write some data on socket 2 and again wait for acknowledgement. During this process socket1 should continue reading data.
I am new to Qt .Do i need to use Threads. Please let me know how can i proceed
@Client::Client(QObject* parent): QObject(parent)
when i do it in the above way the Qt crashes.
If you want to use thread you haven't to use events. You can use functions like ReadyRead, waitforbyteswritten...
Hi and welcome to devnet,
Theses connect statements should not lead to crashes. Where does it happen exactly ?
I think your program crashed because You did not allocate memory to "&client" and "&tcpsocket" using "new " in constructor.
Most of the time Crashes happens Whenever you donot allocate memory to the pointer variables using new operator and you use them directly.
Here in given code ,i can't see the allocation to socket variables.