Skip to content

Commit

Permalink
Wrap net.Conn in DTLS listener
Browse files Browse the repository at this point in the history
Wraps the net.Conn returned from the UDP listener in the DTLS listener.
The underlying UDP listener will be adapted in the future to support
returning net.PacketConn.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
  • Loading branch information
hasheddan committed Aug 9, 2023
1 parent afb61f1 commit f960a37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package dtls
import (
"net"

"github.com/pion/dtls/v2/internal/util"
"github.com/pion/dtls/v2/pkg/protocol"
"github.com/pion/dtls/v2/pkg/protocol/recordlayer"
"github.com/pion/transport/v2/udp"
Expand Down Expand Up @@ -67,7 +68,7 @@ func (l *listener) Accept() (net.Conn, error) {
if err != nil {
return nil, err
}
return Server(c, l.config)
return Server(util.FromConn(c), c.RemoteAddr(), l.config)
}

// Close closes the listener.
Expand Down

0 comments on commit f960a37

Please sign in to comment.