AJ ONeal 89f6e04516
feat(cmd/tcpfwd): add graceful shutdown with idle connection tracking
On SIGINT/SIGTERM:
- Stop accepting new connections
- Close connections idle longer than --idle-timeout (default 5s),
  determined by LastRead/LastWrite timestamps tracked per connection pair
- Wait for active connections to drain up to --shutdown-timeout (default 30s)
- Force-close any remaining connections if the timeout is exceeded

Also switches isClosedConn to use errors.Is(err, net.ErrClosed) and
exits the accept loop cleanly when a listener is closed during shutdown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 22:05:04 -07:00
2021-03-10 16:58:54 -07:00
2026-02-12 00:38:04 -07:00
2025-10-11 19:03:58 -06:00

golib

Go Reference

Sometimes a little copying, sometimes a little dependency. Too small for their own repos.

The default branch is dev, but the stable, versioned tags are based on main.

Also, my Go Cheatsheet:

Description
Sometimes a little copying, sometimes a little dependency, but too small for their own repos.
Readme MPL-2.0 16 MiB
Languages
Go 100%