Wireshark-dev: [Wireshark-dev] Disabling idle sleep while a capture is in progress?
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 1 Jul 2019 14:44:00 -0700
If there's a capture in progress, should Wireshark attempt to prevent the system from sleeping when it's deemed "idle"?

1) The arrival of a packet on an adapter being captured on won't necessarily wake the system up.

2) At least on Windows with Npcap and probably WinPcap, the networking stack plumbing required to make capturing work gets dismantled on a sleep/wakeup, so the capture is forced to stop:

	https://github.com/nmap/nmap/issues/1650

(The APIs to do this are OS-dependent.)

Clearly we shouldn't (and perhaps *can't*) prevent the system from sleeping if 1) you clamshell a laptop or 2) the system's on battery power and the battery's running low.  If you're doing a long-running capture, 1) don't clamshell your machine in the middle and 2) leave it plugged in.