Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose quic server closed err #3395

Merged
merged 3 commits into from Apr 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion server.go
Expand Up @@ -20,6 +20,9 @@ import (
"github.com/lucas-clemente/quic-go/logging"
)

// ErrServerClosed is returned by the Listener or EarlyListener's Accept method after a call to Close.
var ErrServerClosed = errors.New("quic: Server closed")

// packetHandler handles packets
type packetHandler interface {
handlePacket(*receivedPacket)
Expand Down Expand Up @@ -284,7 +287,7 @@ func (s *baseServer) Close() error {
return nil
}
if s.serverError == nil {
s.serverError = errors.New("server closed")
s.serverError = ErrServerClosed
}
// If the server was started with ListenAddr, we created the packet conn.
// We need to close it in order to make the go routine reading from that conn return.
Expand Down