Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcs
dfss
Commits
1868373b
Commit
1868373b
authored
May 24, 2016
by
Richer Maximilien
Committed by
Loïck Bonniot
May 24, 2016
Browse files
[c] Add net default timeout
parent
7e697f8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
dfssc/sign/starter.go
View file @
1868373b
...
...
@@ -5,6 +5,7 @@ import (
"fmt"
"strconv"
"sync"
"time"
"dfss"
cAPI
"dfss/dfssc/api"
...
...
@@ -85,6 +86,8 @@ func NewSignatureManager(passphrase string, c *contract.JSON) (*SignatureManager
m
.
mail
=
m
.
auth
.
Cert
.
Subject
.
CommonName
dAPI
.
SetIdentifier
(
m
.
mail
)
net
.
DefaultTimeout
=
viper
.
GetDuration
(
"timeout"
)
m
.
cServer
=
m
.
GetServer
()
go
func
()
{
_
=
net
.
Listen
(
"0.0.0.0:"
+
strconv
.
Itoa
(
viper
.
GetInt
(
"local_port"
)),
m
.
cServer
)
}()
...
...
@@ -234,7 +237,7 @@ func (m *SignatureManager) addPeer(user *pAPI.User) (ready bool, err error) {
// SendReadySign sends the READY signal to the platform, and wait (potentially a long time) for START signal.
func
(
m
*
SignatureManager
)
SendReadySign
()
(
signatureUUID
string
,
err
error
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
10
*
viper
.
GetDuration
(
"timeout"
)
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
10
*
time
.
Minute
)
defer
cancel
()
c
:=
make
(
chan
*
pAPI
.
LaunchSignature
)
...
...
Write
Preview
Supports
Markdown
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