How is the duration for stalled connections determined?

How is the duration for stalled connections determined?

The duration for stalled connections is determined by comparing the time a connection takes to complete with a predefined threshold. If it exceeds this threshold, it's considered stalled.