Solution 1:

It is actually okay to raise the system limits - for example up to 65536 open files. 162 sockets over 5 hours is a relatively low number. It is not going to affect system performance in any way, and does not use up any kind of significant resources.

Ordinarily sockets will eventually go away by themselves after a timeout. However in your case, they're listed as being in state CLOSE_WAIT. This means that the kernel is waiting for the application to call close() on the socket descriptor, and they will not go away automatically.

ath is supposed to be doing just that - so it seems like you've either hit a bug, or have some kind of serious misconfiguration that makes ath behave incorrectly.

As a temporary measure, you can get the sockets closed by closing the ath process. You can see the process ID in your output from lsof, and then use the kill command to close it up. You can start it again from:

/System/Library/PrivateFrameworks/AirTrafficHost.framework/ath