Closed jxs closed 11 months ago
Did you see Connection::close_reason
?
Oh, sorry, you're looking at Endpoint::accept
, not Connection::accept_*
. That will only return None
if you call Endpoint::close
yourself. Any other behavior is a serious Quinn (or async runtime, or OS) bug.
ok, thanks for clarifying!
Accept
'sFuture
Output
isOption<Connecting>
, yieldingNone
when the endpoint is closed.None
can be returned in two situations:endpoint.driver_lost
istrue
endpoint.state.connections.is_some()
istrue
.When an
Endpoint
is created it spawns theEndpointDriver
which its futures "terminate when all clones of theEndpoint
have been dropped, or when an I/O error occurs".In both this situations
EndpointDriver
setsEndpoint
'sdriver_lost
totrue
, which if I understand correctly doesn't allow distinguishing betwen a graceful and an abrupt connection right?If so can we introduce a mechanism to distinguish both situations and then allow
Accept
'sFuture
to beOption<Result<Connection>>
to also let the end user acknowledge when theEndpoint
was properly closed to when was not?I can to submit a PR addressing this if accepted.
Thanks