@@ -117,14 +117,47 @@ private static unsafe MsQuicSafeHandle Create(QuicConnectionOptions options, QUI
117
117
#pragma warning restore SYSLIB0040
118
118
119
119
QUIC_SETTINGS settings = default ( QUIC_SETTINGS ) ;
120
+
120
121
settings . IsSet . PeerUnidiStreamCount = 1 ;
121
122
settings . PeerUnidiStreamCount = ( ushort ) options . MaxInboundUnidirectionalStreams ;
123
+
122
124
settings . IsSet . PeerBidiStreamCount = 1 ;
123
125
settings . PeerBidiStreamCount = ( ushort ) options . MaxInboundBidirectionalStreams ;
126
+
124
127
if ( options . IdleTimeout != TimeSpan . Zero )
125
128
{
126
129
settings . IsSet . IdleTimeoutMs = 1 ;
127
- settings . IdleTimeoutMs = options . IdleTimeout != Timeout . InfiniteTimeSpan ? ( ulong ) options . IdleTimeout . TotalMilliseconds : 0 ;
130
+ settings . IdleTimeoutMs = options . IdleTimeout != Timeout . InfiniteTimeSpan
131
+ ? ( ulong ) options . IdleTimeout . TotalMilliseconds
132
+ : 0 ; // 0 disables the timeout
133
+ }
134
+
135
+ if ( options . KeepAliveInterval != TimeSpan . Zero )
136
+ {
137
+ settings . IsSet . KeepAliveIntervalMs = 1 ;
138
+ settings . KeepAliveIntervalMs = options . KeepAliveInterval != Timeout . InfiniteTimeSpan
139
+ ? ( uint ) options . KeepAliveInterval . TotalMilliseconds
140
+ : 0 ; // 0 disables the keepalive
141
+ }
142
+
143
+ settings . IsSet . ConnFlowControlWindow = 1 ;
144
+ settings . ConnFlowControlWindow = ( uint ) ( options . _initialRecieveWindowSizes ? . Connection ?? QuicDefaults . DefaultConnectionMaxData ) ;
145
+
146
+ settings . IsSet . StreamRecvWindowBidiLocalDefault = 1 ;
147
+ settings . StreamRecvWindowBidiLocalDefault = ( uint ) ( options . _initialRecieveWindowSizes ? . LocallyInitiatedBidirectionalStream ?? QuicDefaults . DefaultStreamMaxData ) ;
148
+
149
+ settings . IsSet . StreamRecvWindowBidiRemoteDefault = 1 ;
150
+ settings . StreamRecvWindowBidiRemoteDefault = ( uint ) ( options . _initialRecieveWindowSizes ? . RemotelyInitiatedBidirectionalStream ?? QuicDefaults . DefaultStreamMaxData ) ;
151
+
152
+ settings . IsSet . StreamRecvWindowUnidiDefault = 1 ;
153
+ settings . StreamRecvWindowUnidiDefault = ( uint ) ( options . _initialRecieveWindowSizes ? . UnidirectionalStream ?? QuicDefaults . DefaultStreamMaxData ) ;
154
+
155
+ if ( options . HandshakeTimeout != TimeSpan . Zero )
156
+ {
157
+ settings . IsSet . HandshakeIdleTimeoutMs = 1 ;
158
+ settings . HandshakeIdleTimeoutMs = options . HandshakeTimeout != Timeout . InfiniteTimeSpan
159
+ ? ( ulong ) options . HandshakeTimeout . TotalMilliseconds
160
+ : 0 ; // 0 disables the timeout
128
161
}
129
162
130
163
QUIC_HANDLE * handle ;
0 commit comments