2 Attachment(s)
QTcpSocket: ConnectingState
Hi,
I've created a simple server-client application and I've a problem abouot the QTcpSocket.
The client request a new connection to the server, this one accept it, but the status of the socket created remain always in ConnectingState.
Is there somebody that know why?
Attached there is my code.
N.B. I'm using Qt 4.3.5.
Re: QTcpSocket: ConnectingState
because the server can accept multiple connections?
Re: QTcpSocket: ConnectingState
Quote:
Originally Posted by
caduel
because the server can accept multiple connections?
What do you means?
The maximum number of pending accepted connections are the default one so...30.
Another thing...the instance of TcpRadioHandler is done (both server and client) in the run() of a QThread.
Re: QTcpSocket: ConnectingState
.......................................
Re: QTcpSocket: ConnectingState
Any idea about the problem?
Re: QTcpSocket: ConnectingState
Quote:
Originally Posted by
fruzzo
What do you means?
The maximum number of pending accepted connections are the default one so...30.
Can you forget the state for time being and transfer the data over socket meanwhile. So we can see, the problem.
Re: QTcpSocket: ConnectingState
Sorry-----------------------------------
Re: QTcpSocket: ConnectingState
Solved...just after the connectToHost I insert an waitForConnected:
socket->connectToHost(hostIp, hostPort);
if (socket->waitForConnected(1000))
qDebug("Connected!");
No I've another kind of problem...After client-server are connected when I sent a message (msg#1) from client to server, the server must response with another message (msg#2) just after the first one but I've a strange behaviour. The msg#1 is received by server with a little bit latency after sended by client (some milliseconds) instead the msg#2 is received by client after 2-3 seconds. why?