From 1a635de69c40bb5f73b1d27b7a2daa911ce31cad Mon Sep 17 00:00:00 2001 From: iulius98 Date: Sun, 20 Feb 2022 17:40:50 +0200 Subject: [PATCH] #454 fixed local transfer --- src/croc/croc.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index bc534d6..5dc565b 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -338,12 +338,19 @@ func (c *Client) setupLocalRelay() { } func (c *Client) broadcastOnLocalNetwork(useipv6 bool) { + var timeLimit time.Duration + //if we don't use an external relay, the broadcast messages need to be sent continuously + if c.Options.OnlyLocal { + timeLimit = -1 * time.Second + } else { + timeLimit = 30 * time.Second + } // look for peers first settings := peerdiscovery.Settings{ Limit: -1, Payload: []byte("croc" + c.Options.RelayPorts[0]), Delay: 20 * time.Millisecond, - TimeLimit: 30 * time.Second, + TimeLimit: timeLimit, } if useipv6 { settings.IPVersion = peerdiscovery.IPv6