QTcpSocket & livetime & deletion
-
Hey!
2 Cases
QTcpSocket = QTcpSocket::connectToHost()
and QTcpServer : nextPendingConnection()
Both of them are sockets with conections.
The question I have... if I deleteLater() the sockets, do the connection get automatically disconnected, or do they remain active?Secondly if I set option,
QAbstractSocket::KeepAliveOption
, does the connection then remain active after I delete socket?Just trying to understand some odd cases where I delete socket and my server/client still remains connected...
TIA
-
@Dariusz said in QTcpSocket & livetime & deletion:
if I deleteLater() the sockets, do the connection get automatically disconnected, or do they remain active?
-
TCP will disconnect after a standard timout in lieu of an explicit close. setsockopt() can set the timeout.
-
@Dariusz said in QTcpSocket & livetime & deletion:
if I deleteLater() the sockets, do the connection get automatically disconnected, or do they remain active?