From 7d07f65f7f03d11b153ece00ba0e96525959ea79 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 28 Oct 2022 14:47:03 +0300 Subject: [PATCH] Client: Added IsConnected property --- SMBLibrary/Client/ISMBClient.cs | 7 ++++++- SMBLibrary/Client/SMB1Client.cs | 10 +++++++++- SMBLibrary/Client/SMB2Client.cs | 10 +++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/SMBLibrary/Client/ISMBClient.cs b/SMBLibrary/Client/ISMBClient.cs index 7ff3c85..206fd25 100644 --- a/SMBLibrary/Client/ISMBClient.cs +++ b/SMBLibrary/Client/ISMBClient.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2017-2021 Tal Aloni . All rights reserved. +/* Copyright (C) 2017-2022 Tal Aloni . All rights reserved. * * You can redistribute this program and/or modify it under the terms of * the GNU Lesser Public License as published by the Free Software Foundation, @@ -37,5 +37,10 @@ namespace SMBLibrary.Client { get; } + + bool IsConnected + { + get; + } } } diff --git a/SMBLibrary/Client/SMB1Client.cs b/SMBLibrary/Client/SMB1Client.cs index c015d23..b4808eb 100644 --- a/SMBLibrary/Client/SMB1Client.cs +++ b/SMBLibrary/Client/SMB1Client.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-2022 Tal Aloni . All rights reserved. * * You can redistribute this program and/or modify it under the terms of * the GNU Lesser Public License as published by the Free Software Foundation, @@ -674,6 +674,14 @@ namespace SMBLibrary.Client } } + public bool IsConnected + { + get + { + return m_isConnected; + } + } + public static void TrySendMessage(Socket socket, SMB1Message message) { SessionMessagePacket packet = new SessionMessagePacket(); diff --git a/SMBLibrary/Client/SMB2Client.cs b/SMBLibrary/Client/SMB2Client.cs index ba3f98c..251709f 100644 --- a/SMBLibrary/Client/SMB2Client.cs +++ b/SMBLibrary/Client/SMB2Client.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2017-2021 Tal Aloni . All rights reserved. +/* Copyright (C) 2017-2022 Tal Aloni . All rights reserved. * * You can redistribute this program and/or modify it under the terms of * the GNU Lesser Public License as published by the Free Software Foundation, @@ -619,6 +619,14 @@ namespace SMBLibrary.Client } } + public bool IsConnected + { + get + { + return m_isConnected; + } + } + public static void TrySendCommand(Socket socket, SMB2Command request, byte[] encryptionKey) { SessionMessagePacket packet = new SessionMessagePacket();