-
IdTelnet1.Disconnect(); I see TIdTCPConnection.pas in idTCPConnection.Disconnect calls DisconnectNotifyPeer, but there is no code in DisconnectNotifyPeer |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Typically, the only way that So, to make sure the connection is fully closed, try clearing the
|
Beta Was this translation helpful? Give feedback.
-
Thank you! According to the code you provided, it worked! |
Beta Was this translation helpful? Give feedback.
DisconnectNotifyPeer()
is intentionally empty at the TCP level. It is avirtual
method, various protocol-specific descendants override it when they need to send messages to peers while closing connections. But there is nothing in the Telnet protocol to notify a peer about when closing the connection, which is whyTIdTelnet
does not overrideDisconnectNotifyPeer()
.TIdTelnet
overridesDisconnect()
itself instead, to shut down its internal reading thread while closing the connection.Typically, the only way that
Connect()
would think the socket is already connected after aDisconnect()
is if there is unread data left behind in theIOHandler
'sInputBuffer
. Even though the physical socket has…