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:
parent
9439b8ea2d
commit
6955f19439
2 changed files with 2 additions and 2 deletions
|
@ -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}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue