Hi all,
I'm trying to use QTcpSocket to connect to a server, with the code below I noticed an increase in the number of handles allocated everytime I perform connectToHost not realesed with disconnect ot close.
Am I doing something wrong?
Basically I need to create a new connection every time I need to contact the server, so I need to connect several times during the life of my software.
bool ret;
m_Socket.connectToHost("127.0.0.1", 740);
ret=m_Socket.waitForConnected();
m_Socket.disconnectFromHost();
ret=m_Socket.waitForDisconnected();
se=m_Socket.error();
m_Socket.abort();
m_Socket.close();
bool ret;
QTcpSocket m_Socket;
m_Socket.connectToHost("127.0.0.1", 740);
ret=m_Socket.waitForConnected();
m_Socket.disconnectFromHost();
ret=m_Socket.waitForDisconnected();
QAbstractSocket::SocketError se;
se=m_Socket.error();
m_Socket.abort();
m_Socket.close();
To copy to clipboard, switch view to plain text mode
Any help is appreciated.
Thanks in advance
Bookmarks