mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-04 23:11:29 +02:00
Client: Use static readonly ResponseTimeoutInMilliseconds instead of cost
This commit is contained in:
parent
4ffd9ef128
commit
557936fbab
2 changed files with 4 additions and 4 deletions
|
@ -27,6 +27,7 @@ namespace SMBLibrary.Client
|
|||
|
||||
private static readonly ushort ClientMaxBufferSize = 65535; // Valid range: 512 - 65535
|
||||
private static readonly ushort ClientMaxMpxCount = 1;
|
||||
private static readonly int ResponseTimeoutInMilliseconds = 5000;
|
||||
|
||||
private SMBTransportType m_transport;
|
||||
private bool m_isConnected;
|
||||
|
@ -536,10 +537,9 @@ namespace SMBLibrary.Client
|
|||
|
||||
internal SMB1Message WaitForMessage(CommandName commandName)
|
||||
{
|
||||
const int TimeOut = 5000;
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
while (stopwatch.ElapsedMilliseconds < TimeOut)
|
||||
while (stopwatch.ElapsedMilliseconds < ResponseTimeoutInMilliseconds)
|
||||
{
|
||||
lock (m_incomingQueueLock)
|
||||
{
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace SMBLibrary.Client
|
|||
public static readonly uint ClientMaxReadSize = 1048576;
|
||||
public static readonly uint ClientMaxWriteSize = 1048576;
|
||||
private static readonly ushort DesiredCredits = 16;
|
||||
public static readonly int ResponseTimeoutInMilliseconds = 5000;
|
||||
|
||||
private string m_serverName;
|
||||
private SMBTransportType m_transport;
|
||||
|
@ -485,10 +486,9 @@ namespace SMBLibrary.Client
|
|||
|
||||
internal SMB2Command WaitForCommand(ulong messageID)
|
||||
{
|
||||
const int TimeOut = 5000;
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
while (stopwatch.ElapsedMilliseconds < TimeOut)
|
||||
while (stopwatch.ElapsedMilliseconds < ResponseTimeoutInMilliseconds)
|
||||
{
|
||||
lock (m_incomingQueueLock)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue