-
Notifications
You must be signed in to change notification settings - Fork 23
/
SoulseekClientOptions.cs
510 lines (453 loc) · 28.1 KB
/
SoulseekClientOptions.cs
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
// <copyright file="SoulseekClientOptions.cs" company="JP Dillingham">
// Copyright (c) JP Dillingham. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see https://www.gnu.org/licenses/.
// </copyright>
namespace Soulseek
{
using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Soulseek.Diagnostics;
using Soulseek.Messaging.Messages;
/// <summary>
/// Options for SoulseekClient.
/// </summary>
public class SoulseekClientOptions
{
private readonly Func<string, IPEndPoint, Task<BrowseResponse>> defaultBrowseResponseResolver =
(u, i) => Task.FromResult(new BrowseResponse(Enumerable.Empty<Directory>()));
private readonly Func<string, IPEndPoint, string, Task> defaultEnqueueDownload =
(u, i, f) => Task.CompletedTask;
private readonly Func<string, IPEndPoint, string, Task<int?>> defaultPlaceInQueueResolver =
(u, i, f) => Task.FromResult<int?>(null);
private readonly Func<string, IPEndPoint, Task<UserInfo>> defaultUserInfoResolver =
(u, i) => Task.FromResult(new UserInfo(string.Empty, 0, 0, false));
/// <summary>
/// Initializes a new instance of the <see cref="SoulseekClientOptions"/> class.
/// </summary>
/// <param name="enableListener">A value indicating whether to listen for incoming connections.</param>
/// <param name="listenIPAddress">The IP address on which to listen for incoming connections.</param>
/// <param name="listenPort">The port on which to listen for incoming connections.</param>
/// <param name="enableDistributedNetwork">A value indicating whether to establish distributed network connections.</param>
/// <param name="acceptDistributedChildren">A value indicating whether to accept distributed child connections.</param>
/// <param name="distributedChildLimit">The number of allowed distributed children.</param>
/// <param name="maximumConcurrentUploads">The number of allowed concurrent uploads.</param>
/// <param name="maximumUploadSpeed">The total maximum allowable upload speed, in kibibytes per second.</param>
/// <param name="maximumConcurrentDownloads">The number of allowed concurrent downloads.</param>
/// <param name="maximumDownloadSpeed">The total maximum allowable download speed, in kibibytes per second.</param>
/// <param name="deduplicateSearchRequests">
/// A value indicating whether duplicated distributed search requests should be discarded.
/// </param>
/// <param name="messageTimeout">
/// The message timeout, in milliseconds, used when waiting for a response from the server.
/// </param>
/// <param name="autoAcknowledgePrivateMessages">
/// A value indicating whether to automatically send a private message acknowledgement upon receipt.
/// </param>
/// <param name="autoAcknowledgePrivilegeNotifications">
/// A value indicating whether to automatically send a privilege notification acknowledgement upon receipt.
/// </param>
/// <param name="acceptPrivateRoomInvitations">A value indicating whether to accept private room invitations.</param>
/// <param name="minimumDiagnosticLevel">The minimum level of diagnostic messages to be generated by the client.</param>
/// <param name="startingToken">The starting value for download and search tokens.</param>
/// <param name="serverConnectionOptions">The options for the server message connection.</param>
/// <param name="peerConnectionOptions">The options for peer message connections.</param>
/// <param name="transferConnectionOptions">The options for peer transfer connections.</param>
/// <param name="incomingConnectionOptions">The options for incoming connections.</param>
/// <param name="distributedConnectionOptions">The options for distributed message connections.</param>
/// <param name="userEndPointCache">The user endpoint cache to use when resolving user endpoints.</param>
/// <param name="searchResponseResolver">
/// The delegate used to resolve the <see cref="SearchResponse"/> for an incoming <see cref="SearchRequest"/>.
/// </param>
/// <param name="searchResponseCache">
/// The search response cache to use when a response is not able to be delivered immediately.
/// </param>
/// <param name="browseResponseResolver">
/// The delegate used to resolve the <see cref="BrowseResponse"/> for an incoming <see cref="BrowseRequest"/>.
/// </param>
/// <param name="directoryContentsResolver">
/// The delegate used to resolve the <see cref="Directory"/> for an incoming <see cref="FolderContentsRequest"/>.
/// </param>
/// <param name="userInfoResolver">The delegate used to resolve the <see cref="UserInfo"/> for an incoming <see cref="UserInfoRequest"/>.</param>
/// <param name="enqueueDownload">The delegate invoked upon an receipt of an incoming <see cref="QueueDownloadRequest"/>.</param>
/// <param name="placeInQueueResolver">
/// The delegate used to resolve the <see cref="int"/> response for an incoming request.
/// </param>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when the value supplied for <paramref name="listenPort"/> is not between 1024 and 65535.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when the value supplied for <paramref name="distributedChildLimit"/> is less than zero.
/// </exception>
public SoulseekClientOptions(
bool enableListener = true,
IPAddress listenIPAddress = null,
int listenPort = 50000,
bool enableDistributedNetwork = true,
bool acceptDistributedChildren = true,
int distributedChildLimit = 25,
int maximumConcurrentUploads = 10,
int maximumUploadSpeed = int.MaxValue,
int maximumConcurrentDownloads = int.MaxValue,
int maximumDownloadSpeed = int.MaxValue,
bool deduplicateSearchRequests = true,
int messageTimeout = 5000,
bool autoAcknowledgePrivateMessages = true,
bool autoAcknowledgePrivilegeNotifications = true,
bool acceptPrivateRoomInvitations = false,
DiagnosticLevel minimumDiagnosticLevel = DiagnosticLevel.Info,
int startingToken = 0,
ConnectionOptions serverConnectionOptions = null,
ConnectionOptions peerConnectionOptions = null,
ConnectionOptions transferConnectionOptions = null,
ConnectionOptions incomingConnectionOptions = null,
ConnectionOptions distributedConnectionOptions = null,
IUserEndPointCache userEndPointCache = null,
Func<string, int, SearchQuery, Task<SearchResponse>> searchResponseResolver = null,
ISearchResponseCache searchResponseCache = null,
Func<string, IPEndPoint, Task<BrowseResponse>> browseResponseResolver = null,
Func<string, IPEndPoint, int, string, Task<Directory>> directoryContentsResolver = null,
Func<string, IPEndPoint, Task<UserInfo>> userInfoResolver = null,
Func<string, IPEndPoint, string, Task> enqueueDownload = null,
Func<string, IPEndPoint, string, Task<int?>> placeInQueueResolver = null)
{
EnableListener = enableListener;
ListenIPAddress = listenIPAddress ?? IPAddress.Any;
ListenPort = listenPort;
if (ListenPort < 1024 || ListenPort > IPEndPoint.MaxPort)
{
throw new ArgumentOutOfRangeException(nameof(listenPort), $"Must be between 1024 and {IPEndPoint.MaxPort}");
}
EnableDistributedNetwork = enableDistributedNetwork;
AcceptDistributedChildren = acceptDistributedChildren;
DistributedChildLimit = distributedChildLimit;
if (DistributedChildLimit < 0)
{
throw new ArgumentOutOfRangeException(nameof(distributedChildLimit), "Must be greater than or equal to zero");
}
MaximumConcurrentUploads = maximumConcurrentUploads;
if (MaximumConcurrentUploads < 1)
{
throw new ArgumentOutOfRangeException(nameof(maximumConcurrentUploads), "Must be greater than or equal to one");
}
MaximumUploadSpeed = maximumUploadSpeed;
MaximumConcurrentDownloads = maximumConcurrentDownloads;
if (MaximumConcurrentDownloads < 1)
{
throw new ArgumentOutOfRangeException(nameof(maximumConcurrentDownloads), "Must be greater than or equal to one");
}
MaximumDownloadSpeed = maximumDownloadSpeed;
DeduplicateSearchRequests = deduplicateSearchRequests;
MessageTimeout = messageTimeout;
AutoAcknowledgePrivateMessages = autoAcknowledgePrivateMessages;
AutoAcknowledgePrivilegeNotifications = autoAcknowledgePrivilegeNotifications;
AcceptPrivateRoomInvitations = acceptPrivateRoomInvitations;
MinimumDiagnosticLevel = minimumDiagnosticLevel;
StartingToken = startingToken;
ServerConnectionOptions = (serverConnectionOptions ?? new ConnectionOptions()).WithoutInactivityTimeout();
PeerConnectionOptions = peerConnectionOptions ?? new ConnectionOptions();
TransferConnectionOptions = (transferConnectionOptions ?? new ConnectionOptions()).WithoutInactivityTimeout();
IncomingConnectionOptions = incomingConnectionOptions ?? new ConnectionOptions();
DistributedConnectionOptions = distributedConnectionOptions ?? new ConnectionOptions();
UserEndPointCache = userEndPointCache;
SearchResponseResolver = searchResponseResolver;
SearchResponseCache = searchResponseCache;
BrowseResponseResolver = browseResponseResolver ?? defaultBrowseResponseResolver;
DirectoryContentsResolver = directoryContentsResolver;
UserInfoResolver = userInfoResolver ?? defaultUserInfoResolver;
EnqueueDownload = enqueueDownload ?? defaultEnqueueDownload;
PlaceInQueueResolver = placeInQueueResolver ?? defaultPlaceInQueueResolver;
}
/// <summary>
/// Gets a value indicating whether to accept distributed child connections. (Default = accept).
/// </summary>
public bool AcceptDistributedChildren { get; }
/// <summary>
/// Gets a value indicating whether to accept private room invitations. (Default = false).
/// </summary>
public bool AcceptPrivateRoomInvitations { get; }
/// <summary>
/// Gets a value indicating whether to automatically send a private message acknowledgement upon receipt. (Default = true).
/// </summary>
public bool AutoAcknowledgePrivateMessages { get; }
/// <summary>
/// Gets a value indicating whether to automatically send a privilege notification acknowledgement upon receipt.
/// (Default = true).
/// </summary>
public bool AutoAcknowledgePrivilegeNotifications { get; }
/// <summary>
/// Gets the delegate used to resolve the response for an incoming browse request. (Default = a response with no files
/// or directories).
/// </summary>
public Func<string, IPEndPoint, Task<BrowseResponse>> BrowseResponseResolver { get; }
/// <summary>
/// Gets a value indicating whether duplicated distributed search requests should be discarded. (Default = discard duplicates).
/// </summary>
public bool DeduplicateSearchRequests { get; }
/// <summary>
/// Gets the delegate used to resolve the response for an incoming directory contents request. (Default = a response
/// with an empty directory).
/// </summary>
public Func<string, IPEndPoint, int, string, Task<Directory>> DirectoryContentsResolver { get; }
/// <summary>
/// Gets the number of allowed distributed children. (Default = 100).
/// </summary>
public int DistributedChildLimit { get; }
/// <summary>
/// Gets the options for distributed message connections.
/// </summary>
public ConnectionOptions DistributedConnectionOptions { get; }
/// <summary>
/// Gets a value indicating whether to establish distributed network connections. (Default = enabled).
/// </summary>
public bool EnableDistributedNetwork { get; }
/// <summary>
/// Gets a value indicating whether to listen for incoming connections. (Default = true).
/// </summary>
public bool EnableListener { get; }
/// <summary>
/// Gets the delegate invoked upon an receipt of an incoming <see cref="QueueDownloadRequest"/>. (Default = do nothing).
/// </summary>
/// <remarks>
/// This delegate must throw an Exception to indicate a rejected download. If the thrown Exception is of type
/// <see cref="DownloadEnqueueException"/> the message will be sent to the client, otherwise a default message will be sent.
/// </remarks>
public Func<string, IPEndPoint, string, Task> EnqueueDownload { get; }
/// <summary>
/// Gets the options for incoming connections.
/// </summary>
public ConnectionOptions IncomingConnectionOptions { get; }
/// <summary>
/// Gets the IP Address on which to listen for incoming connections. (Default = IPAddress.Any/"0.0.0.0").
/// </summary>
public IPAddress ListenIPAddress { get; }
/// <summary>
/// Gets the port on which to listen for incoming connections. (Default = 50000).
/// </summary>
public int ListenPort { get; }
/// <summary>
/// Gets the number of allowed concurrent downloads. (Default = int.MaxValue).
/// </summary>
public int MaximumConcurrentDownloads { get; }
/// <summary>
/// Gets the number of allowed concurrent uploads. (Default = 10).
/// </summary>
public int MaximumConcurrentUploads { get; }
/// <summary>
/// Gets the number of upload slots per user.
/// </summary>
/// <remarks>
/// This can be set with reflection for experimentation. It needs to remain 1 in production to avoid causing problems
/// with Soulseek NS.
/// </remarks>
public int MaximumConcurrentUploadsPerUser { get; private set; } = 1;
/// <summary>
/// Gets the total maximum allowable download speed, in kibibytes per second.
/// </summary>
public int MaximumDownloadSpeed { get; }
/// <summary>
/// Gets the total maximum allowable upload speed, in kibibytes per second.
/// </summary>
public int MaximumUploadSpeed { get; }
/// <summary>
/// Gets the message timeout, in milliseconds, used when waiting for a response from the server or peer. (Default = 5000).
/// </summary>
public int MessageTimeout { get; }
/// <summary>
/// Gets the minimum level of diagnostic messages to be generated by the client. (Default = None).
/// </summary>
public DiagnosticLevel MinimumDiagnosticLevel { get; }
/// <summary>
/// Gets the options for peer message connections.
/// </summary>
public ConnectionOptions PeerConnectionOptions { get; }
/// <summary>
/// Gets the delegate used to resolve the <see cref="PlaceInQueueResponse"/> for an incoming request.
/// </summary>
public Func<string, IPEndPoint, string, Task<int?>> PlaceInQueueResolver { get; }
/// <summary>
/// Gets the search response cache to use when a response is not able to be delivered immediately.
/// </summary>
public ISearchResponseCache SearchResponseCache { get; }
/// <summary>
/// Gets the delegate used to resolve the <see cref="SearchResponse"/> for an incoming request. (Default = do not respond).
/// </summary>
public Func<string, int, SearchQuery, Task<SearchResponse>> SearchResponseResolver { get; }
/// <summary>
/// Gets the options for the server message connection.
/// </summary>
public ConnectionOptions ServerConnectionOptions { get; }
/// <summary>
/// Gets the starting value for download and search tokens. (Default = 0).
/// </summary>
public int StartingToken { get; }
/// <summary>
/// Gets the options for peer transfer connections.
/// </summary>
public ConnectionOptions TransferConnectionOptions { get; }
/// <summary>
/// Gets the user endpoint cache to use when resolving user endpoints.
/// </summary>
public IUserEndPointCache UserEndPointCache { get; }
/// <summary>
/// Gets the delegate used to resolve the <see cref="UserInfo"/> for an incoming request. (Default = a blank/zeroed response).
/// </summary>
public Func<string, IPEndPoint, Task<UserInfo>> UserInfoResolver { get; }
/// <summary>
/// Creates a clone of this instance with the substitutions in the specified <paramref name="patch"/> applied.
/// </summary>
/// <param name="patch">The patch containing the desired substitutions.</param>
/// <returns>The cloned instance.</returns>
/// <exception cref="ArgumentNullException">Thrown when the specified <paramref name="patch"/> is null.</exception>
public SoulseekClientOptions With(SoulseekClientOptionsPatch patch)
{
if (patch == null)
{
throw new ArgumentNullException(nameof(patch), "Must not be null");
}
return With(
enableListener: patch.EnableListener,
listenIPAddress: patch.ListenIPAddress,
listenPort: patch.ListenPort,
enableDistributedNetwork: patch.EnableDistributedNetwork,
acceptDistributedChildren: patch.AcceptDistributedChildren,
distributedChildLimit: patch.DistributedChildLimit,
maximumUploadSpeed: patch.MaximumUploadSpeed,
maximumDownloadSpeed: patch.MaximumDownloadSpeed,
deduplicateSearchRequests: patch.DeduplicateSearchRequests,
autoAcknowledgePrivateMessages: patch.AutoAcknowledgePrivateMessages,
autoAcknowledgePrivilegeNotifications: patch.AutoAcknowledgePrivilegeNotifications,
acceptPrivateRoomInvitations: patch.AcceptPrivateRoomInvitations,
serverConnectionOptions: patch.ServerConnectionOptions,
peerConnectionOptions: patch.PeerConnectionOptions,
transferConnectionOptions: patch.TransferConnectionOptions,
incomingConnectionOptions: patch.IncomingConnectionOptions,
distributedConnectionOptions: patch.DistributedConnectionOptions,
userEndPointCache: patch.UserEndPointCache,
searchResponseResolver: patch.SearchResponseResolver,
searchResponseCache: patch.SearchResponseCache,
browseResponseResolver: patch.BrowseResponseResolver,
directoryContentsResolver: patch.DirectoryContentsResolver,
userInfoResolver: patch.UserInfoResolver,
enqueueDownload: patch.EnqueueDownload,
placeInQueueResolver: patch.PlaceInQueueResolver);
}
/// <summary>
/// Creates a clone of this instance with the specified substitutions.
/// </summary>
/// <param name="enableListener">A value indicating whether to listen for incoming connections.</param>
/// <param name="listenIPAddress">The IP address on which to listen for incoming connections.</param>
/// <param name="listenPort">The port on which to listen for incoming connections.</param>
/// <param name="enableDistributedNetwork">A value indicating whether to establish distributed network connections.</param>
/// <param name="acceptDistributedChildren">A value indicating whether to accept distributed child connections.</param>
/// <param name="distributedChildLimit">The number of allowed distributed children.</param>
/// <param name="maximumUploadSpeed">The total maximum allowable upload speed, in kibibytes per second.</param>
/// <param name="maximumDownloadSpeed">The total maximum allowable download speed, in kibibytes per second.</param>
/// <param name="deduplicateSearchRequests">
/// A value indicating whether duplicated distributed search requests should be discarded.
/// </param>
/// <param name="autoAcknowledgePrivateMessages">
/// A value indicating whether to automatically send a private message acknowledgement upon receipt.
/// </param>
/// <param name="autoAcknowledgePrivilegeNotifications">
/// A value indicating whether to automatically send a privilege notification acknowledgement upon receipt.
/// </param>
/// <param name="acceptPrivateRoomInvitations">A value indicating whether to accept private room invitations.</param>
/// <param name="serverConnectionOptions">The options for the server message connection.</param>
/// <param name="peerConnectionOptions">The options for peer message connections.</param>
/// <param name="transferConnectionOptions">The options for peer transfer connections.</param>
/// <param name="incomingConnectionOptions">The options for incoming connections.</param>
/// <param name="distributedConnectionOptions">The options for distributed message connections.</param>
/// <param name="userEndPointCache">The user endpoint cache to use when resolving user endpoints.</param>
/// <param name="searchResponseResolver">
/// The delegate used to resolve the <see cref="SearchResponse"/> for an incoming <see cref="SearchRequest"/>.
/// </param>
/// <param name="searchResponseCache">
/// The search response cache to use when a response is not able to be delivered immediately.
/// </param>
/// <param name="browseResponseResolver">
/// The delegate used to resolve the <see cref="BrowseResponse"/> for an incoming <see cref="BrowseRequest"/>.
/// </param>
/// <param name="directoryContentsResolver">
/// The delegate used to resolve the <see cref="Directory"/> for an incoming <see cref="FolderContentsRequest"/>.
/// </param>
/// <param name="userInfoResolver">The delegate used to resolve the <see cref="UserInfo"/> for an incoming <see cref="UserInfoRequest"/>.</param>
/// <param name="enqueueDownload">The delegate invoked upon an receipt of an incoming <see cref="QueueDownloadRequest"/>.</param>
/// <param name="placeInQueueResolver">
/// The delegate used to resolve the <see cref="int"/> response for an incoming request.
/// </param>
/// <returns>The cloned instance.</returns>
internal SoulseekClientOptions With(
bool? enableListener = null,
IPAddress listenIPAddress = null,
int? listenPort = null,
bool? enableDistributedNetwork = null,
bool? acceptDistributedChildren = null,
int? distributedChildLimit = null,
int? maximumUploadSpeed = null,
int? maximumDownloadSpeed = null,
bool? deduplicateSearchRequests = null,
bool? autoAcknowledgePrivateMessages = null,
bool? autoAcknowledgePrivilegeNotifications = null,
bool? acceptPrivateRoomInvitations = null,
ConnectionOptions serverConnectionOptions = null,
ConnectionOptions peerConnectionOptions = null,
ConnectionOptions transferConnectionOptions = null,
ConnectionOptions incomingConnectionOptions = null,
ConnectionOptions distributedConnectionOptions = null,
IUserEndPointCache userEndPointCache = null,
Func<string, int, SearchQuery, Task<SearchResponse>> searchResponseResolver = null,
ISearchResponseCache searchResponseCache = null,
Func<string, IPEndPoint, Task<BrowseResponse>> browseResponseResolver = null,
Func<string, IPEndPoint, int, string, Task<Directory>> directoryContentsResolver = null,
Func<string, IPEndPoint, Task<UserInfo>> userInfoResolver = null,
Func<string, IPEndPoint, string, Task> enqueueDownload = null,
Func<string, IPEndPoint, string, Task<int?>> placeInQueueResolver = null)
{
return new SoulseekClientOptions(
enableListener: enableListener ?? EnableListener,
listenIPAddress: listenIPAddress ?? ListenIPAddress,
listenPort: listenPort ?? ListenPort,
enableDistributedNetwork: enableDistributedNetwork ?? EnableDistributedNetwork,
acceptDistributedChildren: acceptDistributedChildren ?? AcceptDistributedChildren,
distributedChildLimit: distributedChildLimit ?? DistributedChildLimit,
maximumConcurrentUploads: MaximumConcurrentUploads,
maximumUploadSpeed: maximumUploadSpeed ?? MaximumUploadSpeed,
maximumConcurrentDownloads: MaximumConcurrentDownloads,
maximumDownloadSpeed: maximumDownloadSpeed ?? MaximumDownloadSpeed,
deduplicateSearchRequests: deduplicateSearchRequests ?? DeduplicateSearchRequests,
messageTimeout: MessageTimeout,
autoAcknowledgePrivateMessages: autoAcknowledgePrivateMessages ?? AutoAcknowledgePrivateMessages,
autoAcknowledgePrivilegeNotifications: autoAcknowledgePrivilegeNotifications ?? AutoAcknowledgePrivilegeNotifications,
acceptPrivateRoomInvitations: acceptPrivateRoomInvitations ?? AcceptPrivateRoomInvitations,
minimumDiagnosticLevel: MinimumDiagnosticLevel,
startingToken: StartingToken,
serverConnectionOptions: (serverConnectionOptions ?? ServerConnectionOptions).WithoutInactivityTimeout(),
peerConnectionOptions: peerConnectionOptions ?? PeerConnectionOptions,
transferConnectionOptions: (transferConnectionOptions ?? TransferConnectionOptions).WithoutInactivityTimeout(),
incomingConnectionOptions: incomingConnectionOptions ?? IncomingConnectionOptions,
distributedConnectionOptions: distributedConnectionOptions ?? DistributedConnectionOptions,
userEndPointCache: userEndPointCache ?? UserEndPointCache,
searchResponseResolver: searchResponseResolver ?? SearchResponseResolver,
searchResponseCache: searchResponseCache ?? SearchResponseCache,
browseResponseResolver: browseResponseResolver ?? BrowseResponseResolver,
directoryContentsResolver: directoryContentsResolver ?? DirectoryContentsResolver,
userInfoResolver: userInfoResolver ?? UserInfoResolver,
enqueueDownload: enqueueDownload ?? EnqueueDownload,
placeInQueueResolver: placeInQueueResolver ?? PlaceInQueueResolver);
}
}
}