-
Couldn't load subscription status.
- Fork 5.2k
Closed
Description
QuicListener.AcceptConnectionAsync throws in the following scenarios (that I know of):
QuicExceptionwithQuicError.OperationAborted. Happens when the listener is disposed while waiting for a connection.ObjectDisposedException. Happens whenAcceptConnectionAsyncis called after disposing the listener.AuthenticationException. Happens when the client and server fail to negotiate a connection, e.g. server has an invalid certificate and the client rejects it.ArgumentException. Happens when the options returned from the callback are invalid. e.g. a server certificate isn't configured in the callback.- Any exception is thrown in the callback. Happens when an exception is thrown in the callback and is then rethrown from
AcceptConnectionAsync.
I think 5 is very broad. There should be a way to disambiguate a rethrown exception from important exceptions that are used to signal the health of the listener. e.g. someone could accidentally throw an ODE in the callback, which the code that calls the listener interprets as the listener is shut down and to stop listening for connections.
I think the exception from 5, and maybe also 3 and 4, should be wrapped in another exception that says an attempt to accept a connection failed. The inner exception then provides more detail.