1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use Duration;
use crateTimestamp;
use ;
use Server;
/// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2
/// connections.
///
/// Tonic default is no limit (`None`) which is the same as u32::MAX.
///
/// [spec]: https://http2.github.io/http2-spec/#SETTINGS_MAX_CONCURRENT_STREAMS
pub const DEFAULT_MAX_CONCURRENT_STREAMS: u32 = u32MAX;
/// Sets a timeout for receiving an acknowledgement of the keepalive ping.
///
/// If the ping is not acknowledged within the timeout, the connection will be closed.
/// Does nothing if http2_keep_alive_interval is disabled.
///
/// Tonic default is 20 seconds.
pub const DEFAULT_SERVER_KEEP_ALIVE_TIMEOUT: Duration = from_secs;
/// Set whether HTTP2 Ping frames are enabled on accepted connections.
///
/// If `None` is specified, HTTP2 keepalive is disabled, otherwise the duration
/// specified will be the time interval between HTTP2 Ping frames.
/// The timeout for receiving an acknowledgement of the keepalive ping
/// can be set with [`Server::http2_keepalive_timeout`].
///
/// Tonic default is no HTTP2 keepalive (`None`)
/// Avalanche default is 2 hours.
pub const DEFAULT_SERVER_KEEP_ALIVE_INTERVAL: Duration = from_secs;
/// Set whether TCP keepalive messages are enabled on accepted connections.
///
/// If `None` is specified, keepalive is disabled, otherwise the duration
/// specified will be the time to remain idle before sending TCP keepalive
/// probes.
///
/// Default is no keepalive (`None`)
/// Avalanche default is 5 seconds.
pub const DEFAULT_SERVER_KEEP_ALIVE_MIN_TIME: Duration = from_secs;
/// Returns a gRPC server with proper defaults.