diff options
| author | Marin Ivanov <[email protected]> | 2019-03-24 22:21:08 +0200 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2019-03-24 22:21:08 +0200 |
| commit | c9585c36afe0c502c91e5ad527af1c71a80feb0a (patch) | |
| tree | 3a8adf46ced72bea7410ed377c116af4330f6883 /ssh.go | |
| parent | 6ab1613157a6a5d3eabf9d2fe2adf4699d29a5ba (diff) | |
Add Makefile and configurable delay
Diffstat (limited to 'ssh.go')
| -rw-r--r-- | ssh.go | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -9,16 +9,14 @@ import ( "time" ) -type empty struct{} - -func sshHandler(conn net.Conn) { +func sshHandler(conn net.Conn, delay time.Duration) { eof := make(chan empty) go func() { io.Copy(ioutil.Discard, conn) eof <- empty{} }() - tick := time.Tick(10 * time.Second) + tick := time.Tick(delay) for { select { case <-eof: |
