File tree 4 files changed +13
-4
lines changed
4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ Known issues:
15
15
16
16
### Fixed
17
17
18
- - removing a hidden loop taht cause webexec to hang
18
+ - forever trying to reconnect to peerbook
19
+ - removing a hidden loop that could cause webexec to hang
19
20
20
21
21
22
## [ 0.10.5] - 2021-4-25
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ disconnect = 3000
33
33
failed = 6000
34
34
keep_alive = 500
35
35
ice_gathering = 5000
36
+ peerbook = 3000
36
37
[env]
37
38
COLORTERM = "truecolor"
38
39
TERM = "xterm"
@@ -48,6 +49,7 @@ var Conf struct {
48
49
failedTimeout time.Duration
49
50
keepAliveInterval time.Duration
50
51
gatheringTimeout time.Duration
52
+ peerbookTimeout time.Duration
51
53
iceServers []string
52
54
httpServer string
53
55
logFilePath string
@@ -108,6 +110,12 @@ func parseConf(s string) error {
108
110
} else {
109
111
Conf .gatheringTimeout = 3 * time .Second
110
112
}
113
+ v = t .Get ("timeouts.peerbook" )
114
+ if v != nil {
115
+ Conf .peerbookTimeout = time .Duration (v .(int64 )) * time .Millisecond
116
+ } else {
117
+ Conf .peerbookTimeout = 3 * time .Second
118
+ }
111
119
v = t .Get ("net.ice_servers" )
112
120
if v != nil {
113
121
urls := v .([]interface {})
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ All values are in Milliseconds
29
29
- failed: the failed timeout, default: 6000
30
30
- keep_alive: how long to wait between keep alive messages, default 500
31
31
- ice_gathering: gathering timeout, default 5000
32
+ - peerbook: how long to wait before peerbook reconnnect, default 3000
32
33
33
34
### env
34
35
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ import (
17
17
var wsWriteM sync.Mutex
18
18
19
19
func signalingGo () {
20
- start:
21
20
c , err := dialWS ()
22
21
if err != nil {
23
22
Logger .Errorf ("Failed to dial the signaling server: %q" , err )
29
28
mType , m , err := c .ReadMessage ()
30
29
if err != nil {
31
30
Logger .Errorf ("Signaling read error" , err )
32
- c .Close ()
33
- goto start
31
+ break
34
32
}
35
33
if mType == websocket .TextMessage {
36
34
Logger .Info ("Received text message" , string (m ))
40
38
}
41
39
}
42
40
}
41
+ time .AfterFunc (Conf .peerbookTimeout , signalingGo )
43
42
}
44
43
func getFP () string {
45
44
certs , err := GetCerts ()
You can’t perform that action at this time.
0 commit comments