imsnif / bandwhich

Terminal bandwidth utilization tool
MIT License
10.09k stars 299 forks source link

Show process id for 'UNKNOWN' #426

Closed jacobzeng closed 1 month ago

jacobzeng commented 1 month ago

Can we use displaying process ID to replace "UNKNOWN"

cyqsimon commented 1 month ago

That would have been done had it been possible.

The trouble is, UNKNOWN here indicates we are unable to resolve a particular open socket to a process at all, so we don't even know what the PID is. The technical reason for this is that currently we only perform this resolve at the moment of every refresh, which may fail because there often are transient connections that have vanished during the refresh interval.

There's most certainly a better way to code this, but it takes quite a lot of refactoring (which I have been doing, but very slowly™️ because I've got work that actually pays my bills).