pion / dtls

DTLS 1.2 Server/Client implementation for Go
https://pion.ly/
MIT License
602 stars 160 forks source link

dlts server Listener.Accept may block due to individual connection timeouts. #618

Closed kitestar closed 8 months ago

kitestar commented 8 months ago
func (l *listener) Accept() (net.Conn, error) {
    c, raddr, err := l.parent.Accept()
    if err != nil {
        return nil, err
    }
    return Server(c, raddr, l.config)
}

Server() ---> createConn ---> handshake use synchronous handshaking

If one connection's handshake times out, it directly affects the next connection's accept.

Why not use an asynchronous handshake when accepting a connection?

daenney commented 8 months ago

This is a duplicate of #279. It's mostly just an oversight when the API was created, and something we'll resolve eventually.