Struct domain::net::server::ConnectionConfig
source · pub struct ConnectionConfig<RequestOctets, Target> { /* private fields */ }
net
and unstable-server-transport
only.Expand description
Configuration for a stream server connection.
Implementations§
source§impl<RequestOctets, Target> Config<RequestOctets, Target>
impl<RequestOctets, Target> Config<RequestOctets, Target>
sourcepub fn set_idle_timeout(&mut self, value: Duration)
pub fn set_idle_timeout(&mut self, value: Duration)
Set the limit on the amount of time to allow between client requests.
According to RFC 7766:
- “A timeout of at least a few seconds is advisable for normal operations”.
- “Servers MAY use zero timeouts when they are experiencing heavy load or are under attack”.
- “Servers MAY allow idle connections to remain open for longer periods as resources permit”.
The value has to be between zero and 30 days with a default of 30
seconds. The default and minimum values are the same as those of the
Unbound 1.19.2 tcp-idle-timeout
configuration setting. The upper
bound is a guess at something reasonable.
§Reconfigure
On StreamServer::reconfigure
the current idle period will NOT be
affected. Subsequent idle periods (after the next message is received
or response is sent, assuming that happens within the current idle
period) will use the new timeout value.
sourcepub fn set_response_write_timeout(&mut self, value: Duration)
pub fn set_response_write_timeout(&mut self, value: Duration)
Set the limit on the amount of time to wait for writing a response to complete.
The value has to be between 1 millisecond and 1 hour with a default of
30 seconds. These values are guesses at something reasonable. The
default is based on the Unbound 1.19.2 default value for its
tcp-idle-timeout
setting.
§Reconfigure
On StreamServer::reconfigure
any responses currently being
written will NOT use the new timeout, it will only apply to responses
that start being sent after the timeout is changed.
sourcepub fn set_max_queued_responses(&mut self, value: usize)
pub fn set_max_queued_responses(&mut self, value: usize)
Set the limit on the number of DNS responses queued for writing to the client.
The value has to be between zero and 1,024. The default value is 10. These numbers are just a guess at something reasonable.
DNS response messages will be discarded if they cannot be queued for sending because the queue is full.
§Reconfigure
On StreamServer::reconfigure
only new connections created after
this setting is changed will use the new value, existing connections
will continue to use their exisitng queue at its existing size.
sourcepub fn set_middleware_chain(
&mut self,
value: MiddlewareChain<RequestOctets, Target>
)
pub fn set_middleware_chain( &mut self, value: MiddlewareChain<RequestOctets, Target> )
Set the middleware chain used to pre-process requests and post-process responses.
§Reconfigure
On StreamServer::reconfigure
only new connections created after
this setting is changed will use the new value, existing connections
and in-flight requests (and their responses) will continue to use
their current middleware chain.