summaryrefslogtreecommitdiff
path: root/vendor/github.com/pion/dtls/v2/resume.go
blob: 40e55e449795493e394f9d4a2d15d27645fdfc1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package dtls

import (
	"context"
	"net"
)

// Resume imports an already established dtls connection using a specific dtls state
func Resume(state *State, conn net.Conn, config *Config) (*Conn, error) {
	if err := state.initCipherSuite(); err != nil {
		return nil, err
	}
	c, err := createConn(context.Background(), conn, config, state.isClient, state)
	if err != nil {
		return nil, err
	}

	return c, nil
}