0

I have a problem with the QTcpSocket library.

I created two programs that communicate with the same client using the same socket connection. Unfortunately, doing in this way, if the programs write at the same time, the client reads only one string by the socket (generally the first one).

So i need to know if a particular function exists (or a way) to know if the socket is or not busy in order to delay the second string to send.

Thanks in advance.

Mahmoud Al-Qudsi
  • 28,357
  • 12
  • 85
  • 125
Daniele
  • 45
  • 5
  • 3
    What you describe doesn't make sense. Please show the relevant parts of both the sending and receiving code. – Mat May 27 '12 at 10:59
  • *"I created two programs that communicate with the same client using the same socket connection."* This is impossible. Please clarify your question with some code to get productive answers. – leemes May 27 '12 at 13:01

1 Answers1

1

You can't have 2 clients using the same socket. The server should work with a QTcpServer and everytime you receive a new connection (from a client) you create a new QTcpSocket (Obviously, everything server-side for now). And the client works with a QTcpSocket to connect to the server.

Blastcore
  • 360
  • 7
  • 19