Skip to content

Commit 1234d55

Browse files
committed
Expose Client Permission Refresh Interval
Resolves #458
1 parent cb6f2d0 commit 1234d55

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

client.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ type ClientConfig struct {
4848
Net transport.Net
4949
LoggerFactory logging.LoggerFactory
5050

51-
evenPort bool // If EVEN-PORT Attribute should be sent in Allocation
52-
reservationToken []byte // If Server responds with RESERVATION-TOKEN or if Client wishes to send one
53-
permissionRefreshInterval time.Duration
54-
bindingRefreshInterval time.Duration
55-
bindingCheckInterval time.Duration
51+
// PermissionTimeout sets the refresh interval of permissions. Defaults to 2 minutes.
52+
PermissionRefreshInterval time.Duration
53+
54+
evenPort bool // If EVEN-PORT Attribute should be sent in Allocation
55+
reservationToken []byte // If Server responds with RESERVATION-TOKEN or if Client wishes to send one
56+
bindingRefreshInterval time.Duration
57+
bindingCheckInterval time.Duration
5658
}
5759

5860
// Client is a STUN server client.
@@ -146,7 +148,7 @@ func NewClient(config *ClientConfig) (*Client, error) {
146148
log: log,
147149
evenPort: config.evenPort,
148150
reservationToken: config.reservationToken,
149-
permissionRefreshInterval: config.permissionRefreshInterval,
151+
permissionRefreshInterval: config.PermissionRefreshInterval,
150152
bindingRefreshInterval: config.bindingRefreshInterval,
151153
bindingCheckInterval: config.bindingCheckInterval,
152154
}

client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ func TestClientE2E(t *testing.T) {
590590
TURNServerAddr: testAddr,
591591
Username: "foo",
592592
Password: "pass",
593-
permissionRefreshInterval: time.Millisecond * 50,
593+
PermissionRefreshInterval: time.Millisecond * 50,
594594
bindingRefreshInterval: time.Millisecond * 50,
595595
bindingCheckInterval: time.Millisecond * 50,
596596
})

0 commit comments

Comments
 (0)