This is a handle on a server-side connection before configuration is available. This is a replacement for LazyConfigAcceptor which has no way to retrieve the client IO stream after an error.
AsyncAcceptor has a function take_io which can be used take back ownership of the client IO stream.
An example of this is when a client tries to connect to an TLS socket expecting it to be plain text connection. In this case take_io can be used to send a 400 response, "The plain HTTP request was sent to HTTPS port", back to the client.
The reason for a new struct is not break the API of LazyConfigAcceptor.
This is a handle on a server-side connection before configuration is available. This is a replacement for
LazyConfigAcceptor
which has no way to retrieve the client IO stream after an error.AsyncAcceptor
has a functiontake_io
which can be used take back ownership of the client IO stream.An example of this is when a client tries to connect to an TLS socket expecting it to be plain text connection. In this case
take_io
can be used to send a 400 response, "The plain HTTP request was sent to HTTPS port", back to the client.The reason for a new struct is not break the API of
LazyConfigAcceptor
.