cli: rename -reconnect-delay to -reconnect-delay-secs

All time arguments now use -secs suffix with integer seconds for
consistency (-reconnect-delay-secs, -keepalive-timeout-secs).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Git Sagar 2026-07-11 11:56:37 -03:00
parent 1a397c363f
commit 9e050b140b
3 changed files with 6 additions and 5 deletions

View file

@ -57,7 +57,7 @@ pkg/tap/
## CLI flags ## CLI flags
Required: `-host`, `-user` Required: `-host`, `-user`
Optional: `-pass`, `-port` (443), `-hub` (DEFAULT), `-tap` (auto), `-mac`, `-plain-password`, `-insecure`, `-no-dhcp`, `-accept-default-gateway`, `-accept-static-routes`, `-accept-dns`, `-policy-route-table` (0=disabled), `-connmark`, `-reconnect-delay` (5s), `-keepalive-timeout-secs` (0=disabled) Optional: `-pass`, `-port` (443), `-hub` (DEFAULT), `-tap` (auto), `-mac`, `-plain-password`, `-insecure`, `-no-dhcp`, `-accept-default-gateway`, `-accept-static-routes`, `-accept-dns`, `-policy-route-table` (0=disabled), `-connmark`, `-reconnect-delay-secs` (5), `-keepalive-timeout-secs` (0=disabled)
## SoftEther protocol pitfalls ## SoftEther protocol pitfalls

View file

@ -83,7 +83,7 @@ softether-go [flags]
| `-policy-route-table` | `0` | Policy routing table number (0 = disabled) | | `-policy-route-table` | `0` | Policy routing table number (0 = disabled) |
| `-connmark` | `false` | Use CONNMARK to route DNAT reply traffic back through VPN | | `-connmark` | `false` | Use CONNMARK to route DNAT reply traffic back through VPN |
| `-keepalive-timeout-secs` | `0` | Close connection if no server data within N seconds (0 = disabled) | | `-keepalive-timeout-secs` | `0` | Close connection if no server data within N seconds (0 = disabled) |
| `-reconnect-delay` | `5s` | Delay between reconnection attempts | | `-reconnect-delay-secs` | `5` | Delay between reconnection attempts in seconds |
### Authentication ### Authentication

View file

@ -31,7 +31,7 @@ func main() {
macAddr := flag.String("mac", "", "TAP interface MAC address (e.g. 5E:3B:6F:63:A8:3E)") macAddr := flag.String("mac", "", "TAP interface MAC address (e.g. 5E:3B:6F:63:A8:3E)")
insecure := flag.Bool("insecure", false, "Skip TLS certificate verification") insecure := flag.Bool("insecure", false, "Skip TLS certificate verification")
noDHCP := flag.Bool("no-dhcp", false, "Disable built-in DHCP client") noDHCP := flag.Bool("no-dhcp", false, "Disable built-in DHCP client")
reconnectDelay := flag.Duration("reconnect-delay", 5*time.Second, "Delay between reconnection attempts") reconnectDelay := flag.Int("reconnect-delay-secs", 5, "Delay between reconnection attempts in seconds")
acceptDefaultGW := flag.Bool("accept-default-gateway", false, "Install DHCP-provided gateway as default route") acceptDefaultGW := flag.Bool("accept-default-gateway", false, "Install DHCP-provided gateway as default route")
acceptStaticRoutes := flag.Bool("accept-static-routes", false, "Install DHCP classless static routes (option 121/249)") acceptStaticRoutes := flag.Bool("accept-static-routes", false, "Install DHCP classless static routes (option 121/249)")
acceptDNS := flag.Bool("accept-dns", false, "Set /etc/resolv.conf from DHCP-provided DNS servers") acceptDNS := flag.Bool("accept-dns", false, "Set /etc/resolv.conf from DHCP-provided DNS servers")
@ -106,13 +106,14 @@ func main() {
return return
} }
log.Printf("session ended: %v", err) log.Printf("session ended: %v", err)
log.Printf("reconnecting in %v...", *reconnectDelay) delay := time.Duration(*reconnectDelay) * time.Second
log.Printf("reconnecting in %v...", delay)
select { select {
case <-sig: case <-sig:
log.Println("shutting down") log.Println("shutting down")
return return
case <-time.After(*reconnectDelay): case <-time.After(delay):
} }
} }
} }