I am using TTCPBlockSocket
for a TCP/IP Application . The problem is that I can't determine when the connection is lost.
GetLastError
returns 0
Read
returns 0
But I encounter these values eaven if the application is connected so I can get it how can I be notified when the TCP/IP connection is lost.
Thanks
CanRead
function call passing 0 asTimeout
parameter is what you're looking for. This function internally callsInternalCanRead
which performs the Winsockselect
function. TheCanRead
function returns False if any error occurs. – Hoppe