Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
0a8f75d6
Commit
0a8f75d6
authored
Feb 26, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make RelayTest take the timeout as parameter.
parent
e8bc42d8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
galene.go
galene.go
+1
-1
ice/ice.go
ice/ice.go
+3
-3
No files found.
galene.go
View file @
0a8f75d6
...
...
@@ -130,7 +130,7 @@ func main() {
func
relayTest
()
{
now
:=
time
.
Now
()
d
,
err
:=
ice
.
RelayTest
()
d
,
err
:=
ice
.
RelayTest
(
20
*
time
.
Second
)
if
err
!=
nil
{
log
.
Printf
(
"Relay test failed: %v"
,
err
)
log
.
Printf
(
"Perhaps you didn't configure a TURN server?"
)
...
...
ice/ice.go
View file @
0a8f75d6
...
...
@@ -137,7 +137,7 @@ func ICEConfiguration() *webrtc.Configuration {
return
&
conf
.
conf
}
func
RelayTest
()
(
time
.
Duration
,
error
)
{
func
RelayTest
(
timeout
time
.
Duration
)
(
time
.
Duration
,
error
)
{
conf
:=
ICEConfiguration
()
conf2
:=
*
conf
...
...
@@ -223,7 +223,7 @@ func RelayTest() (time.Duration, error) {
})
})
timer
:=
time
.
NewTimer
(
20
*
time
.
Second
)
timer
:=
time
.
NewTimer
(
timeout
)
defer
timer
.
Stop
()
select
{
case
err
:=
<-
ch1
:
...
...
@@ -235,6 +235,6 @@ func RelayTest() (time.Duration, error) {
}
return
time
.
Now
()
.
Sub
(
tm
),
nil
case
<-
timer
.
C
:
return
0
,
errors
.
New
(
"timeout"
)
return
0
,
os
.
ErrDeadlineExceeded
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment