0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

recipient can easily stop now

This commit is contained in:
Zack Scholl 2018-10-09 19:01:50 -07:00
parent 9439b8ea2d
commit 6955f19439
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@ type Comm struct {
func New(c net.Conn) Comm { func New(c net.Conn) Comm {
c.SetReadDeadline(time.Now().Add(3 * time.Hour)) c.SetReadDeadline(time.Now().Add(3 * time.Hour))
c.SetDeadline(time.Now().Add(3 * time.Hour)) c.SetDeadline(time.Now().Add(3 * time.Hour))
c.SetWriteDeadline(time.Now().Add(3 * time.Hour)) c.SetWriteDeadline(time.Now().Add(5 * time.Second))
return Comm{c} return Comm{c}
} }

View file

@ -183,7 +183,7 @@ func (c *Croc) sendReceive(address, websocketPort string, tcpPorts []string, fna
} }
select { select {
case <-done: case <-done:
case <-time.After(time.Second): case <-time.After(100 * time.Millisecond):
} }
return nil return nil
} }