Client: NetBIOS over TCP: Apply timeout set by the client instead of hardcoded value

This commit is contained in:
Tal Aloni 2024-06-01 12:39:25 +03:00
parent dd7b945ddc
commit cf182e787f
2 changed files with 2 additions and 4 deletions

View file

@ -585,10 +585,9 @@ namespace SMBLibrary.Client
internal SessionPacket WaitForSessionResponsePacket()
{
const int TimeOut = 5000;
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
while (stopwatch.ElapsedMilliseconds < TimeOut)
while (stopwatch.ElapsedMilliseconds < m_responseTimeoutInMilliseconds)
{
if (m_sessionResponsePacket != null)
{

View file

@ -555,10 +555,9 @@ namespace SMBLibrary.Client
internal SessionPacket WaitForSessionResponsePacket()
{
const int TimeOut = 5000;
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
while (stopwatch.ElapsedMilliseconds < TimeOut)
while (stopwatch.ElapsedMilliseconds < m_responseTimeoutInMilliseconds)
{
if (m_sessionResponsePacket != null)
{