mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-15 08:56:56 +02:00
Client: Throw Exception if attemping to logoff when the client is not connected
This commit is contained in:
parent
2b3cee14a5
commit
6a03cfd952
2 changed files with 10 additions and 0 deletions
|
@ -236,6 +236,11 @@ namespace SMBLibrary.Client
|
||||||
|
|
||||||
public NTStatus Logoff()
|
public NTStatus Logoff()
|
||||||
{
|
{
|
||||||
|
if (!m_isConnected)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("A login session must be successfully established before attempting logoff");
|
||||||
|
}
|
||||||
|
|
||||||
LogoffAndXRequest request = new LogoffAndXRequest();
|
LogoffAndXRequest request = new LogoffAndXRequest();
|
||||||
TrySendMessage(request);
|
TrySendMessage(request);
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,11 @@ namespace SMBLibrary.Client
|
||||||
|
|
||||||
public NTStatus Logoff()
|
public NTStatus Logoff()
|
||||||
{
|
{
|
||||||
|
if (!m_isConnected)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("A login session must be successfully established before attempting logoff");
|
||||||
|
}
|
||||||
|
|
||||||
LogoffRequest request = new LogoffRequest();
|
LogoffRequest request = new LogoffRequest();
|
||||||
TrySendCommand(request);
|
TrySendCommand(request);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue