diff --git a/examples/listen/cid/main.go b/examples/listen/cid/main.go index 25cc3287..7418d895 100644 --- a/examples/listen/cid/main.go +++ b/examples/listen/cid/main.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "net" + "time" "github.com/pion/dtls/v3" "github.com/pion/dtls/v3/examples/util" @@ -57,7 +58,7 @@ func main() { // functions like `ConnectionState` etc. // Perform the handshake with a 30-second timeout - ctx, cancel := context.WithTimeout(context.Background(), 30) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) dtlsConn, ok := conn.(*dtls.Conn) if ok { util.Check(dtlsConn.HandshakeContext(ctx)) diff --git a/examples/listen/psk/main.go b/examples/listen/psk/main.go index 4fdcc838..041b1fb4 100644 --- a/examples/listen/psk/main.go +++ b/examples/listen/psk/main.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "net" + "time" "github.com/pion/dtls/v3" "github.com/pion/dtls/v3/examples/util" @@ -56,7 +57,7 @@ func main() { // functions like `ConnectionState` etc. // Perform the handshake with a 30-second timeout - ctx, cancel := context.WithTimeout(context.Background(), 30) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) dtlsConn, ok := conn.(*dtls.Conn) if ok { util.Check(dtlsConn.HandshakeContext(ctx)) diff --git a/examples/listen/selfsign/main.go b/examples/listen/selfsign/main.go index a73b1479..2243d722 100644 --- a/examples/listen/selfsign/main.go +++ b/examples/listen/selfsign/main.go @@ -9,6 +9,7 @@ import ( "crypto/tls" "fmt" "net" + "time" "github.com/pion/dtls/v3" "github.com/pion/dtls/v3/examples/util" @@ -57,7 +58,7 @@ func main() { // functions like `ConnectionState` etc. // Perform the handshake with a 30-second timeout - ctx, cancel := context.WithTimeout(context.Background(), 30) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) dtlsConn, ok := conn.(*dtls.Conn) if ok { util.Check(dtlsConn.HandshakeContext(ctx)) diff --git a/examples/listen/verify-brute-force-protection/main.go b/examples/listen/verify-brute-force-protection/main.go index aaa1a90a..9bf95046 100644 --- a/examples/listen/verify-brute-force-protection/main.go +++ b/examples/listen/verify-brute-force-protection/main.go @@ -115,7 +115,7 @@ func main() { // *************** END Brute Force Attack protection END *************** // Perform the handshake with a 30-second timeout - ctx, cancel := context.WithTimeout(context.Background(), 30) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) dtlsConn, ok := conn.(*dtls.Conn) if ok { util.Check(dtlsConn.HandshakeContext(ctx)) diff --git a/examples/listen/verify/main.go b/examples/listen/verify/main.go index cb19ee60..7d7067a2 100644 --- a/examples/listen/verify/main.go +++ b/examples/listen/verify/main.go @@ -10,6 +10,7 @@ import ( "crypto/x509" "fmt" "net" + "time" "github.com/pion/dtls/v3" "github.com/pion/dtls/v3/examples/util" @@ -66,7 +67,7 @@ func main() { // functions like `ConnectionState` etc. // Perform the handshake with a 30-second timeout - ctx, cancel := context.WithTimeout(context.Background(), 30) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) dtlsConn, ok := conn.(*dtls.Conn) if ok { util.Check(dtlsConn.HandshakeContext(ctx))