Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ namespace Smdn.Net.SkStackIP;
partial class SkStackClient {
private static readonly TimeSpan ReceiveUdpPollingIntervalDefault = TimeSpan.FromMilliseconds(10);

private TimeSpan receiveUdpPollingInterval = ReceiveUdpPollingIntervalDefault;

public TimeSpan ReceiveUdpPollingInterval {
get => receiveUdpPollingInterval;
get;
set {
if (value <= TimeSpan.Zero)
throw new ArgumentOutOfRangeException(message: "must be non-zero positive value", actualValue: value, paramName: nameof(ReceiveUdpPollingInterval));

receiveUdpPollingInterval = value;
field = value;
}
}
} = ReceiveUdpPollingIntervalDefault;

private SkStackERXUDPDataFormat erxudpDataFormat;

Expand Down Expand Up @@ -270,7 +268,7 @@ public ValueTask<IPAddress> ReceiveUdpAsync(
thisClient: this,
pipeReader: pipe.Reader,
bufferWriter: buffer,
eventPollingInterval: receiveUdpPollingInterval,
eventPollingInterval: ReceiveUdpPollingInterval,
cancellationToken: cancellationToken
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,19 @@ void ISkStackSequenceParserContext.SetAsIncomplete(SequenceReader<byte> incomple

private static readonly TimeSpan ReceiveResponseDelayDefault = TimeSpan.FromMilliseconds(10);

private TimeSpan receiveResponseDelay = ReceiveResponseDelayDefault;

/// <summary>
/// Gets or sets the interval to delay before attempting to receive a subsequent sequence
/// if the response sequence currently received is incomplete.
/// </summary>
public TimeSpan ReceiveResponseDelay {
get => receiveResponseDelay;
get;
set {
if (value <= TimeSpan.Zero)
throw new ArgumentOutOfRangeException(message: "must be non-zero positive value", actualValue: value, paramName: nameof(ReceiveResponseDelay));

receiveResponseDelay = value;
field = value;
}
}
} = ReceiveResponseDelayDefault;

private readonly ParseSequenceContext parseSequenceContext;
private SemaphoreSlim streamReaderSemaphore;
Expand Down Expand Up @@ -221,7 +219,7 @@ public TimeSpan ReceiveResponseDelay {
return result;

if (delay)
await Task.Delay(receiveResponseDelay).ConfigureAwait(false);
await Task.Delay(ReceiveResponseDelay).ConfigureAwait(false);

if (loggerReceivingStatus is not null)
LogReceivingStatus(loggerReceivingStatus, $"{callerMemberName} continue reading");
Expand Down
Loading