Hi Wysota,
The server I use closes down for the weekend until later tomorrow, maybe I'll write/test thi with something minimal then but in testing this yesterday I've commented out my code down to either of the following two cases.......it's as minimal as it gets....
in the parent object constructor...... QTcpSocket *pSocket = new QTcpSocket(this);
then in a parent object method the first case.....
pSocket->connectToHost( host, port);
if(!pSocket->waitForConnected(1000))
{
return false;
}
or the second case with just connectToHost() alone.....
pSocket->connectToHost(host, port)
comparing these two cases and looking at the initial tcp/ip 3 packet exchange witih Wireshark(ethereal) the latter works properly. The former results in the client first sending the initial packet with the SYN flag set and a return port of say 30000. But, this is follwed by it sending another packet with SYN but the return port is incremented by 1. It's as if the first attempt failed and so it attempts again. The third packet is the server sending SYN and ACK to the first request. The client then sends RST to close that connection!! All as if "waitForConnect" is somehow adversely affecting things andI have no idea why.
Bookmarks