This is a commonly asked question, so it is not specific to any version. It is also a commonly asked question in socket programming in general, eg. see stackoverflow.
mIRC uses several methods to detect connection timeouts, eg. socket keepalives, pings to the server (the "Check for connection time out" option, which is enabled by default), and so on.
If it is still not detecting a connection error, this means that something else is going on, eg. there is an issue with your router, Windows, the server, ZNC, firewall, that particular connection, etc.
If you use the "/debug @debug" command, this will show incoming/outgoing server messages in a @debug window. You can use this to monitor the "Check for connection time out" which will send a ping to the server if there has been no activity for a few minutes.