closeQuietly

Closes this resource, swallowing any Exception thrown by AutoCloseable.close.

Only Exception is swallowed: Errors and other non-Exception throwables propagate to the caller. Intended for cleanup paths where a secondary close failure must not mask the failure already being handled.

try { work(socket) } finally { socket.closeQuietly() }