SharpCifs.Smb.SmbSession.Logoff C# (CSharp) Method

Logoff() private method

private Logoff ( bool inError ) : void
inError bool
return void
		internal void Logoff(bool inError)
		{
			lock (Transport())
			{
				if (ConnectionState != 2)
				{
					// not-connected
					return;
				}
				ConnectionState = 3;
				// disconnecting
				NetbiosName = null;

                foreach (SmbTree t in Trees)
			    {
			        t.TreeDisconnect(inError);
			    }

                if (!inError && transport.Server.Security != SmbConstants.SecurityShare)
				{
					SmbComLogoffAndX request = new SmbComLogoffAndX(null);
					request.Uid = Uid;
					try
					{
						transport.Send(request, null);
					}
					catch (SmbException)
					{
					}
					Uid = 0;
				}
				ConnectionState = 0;
				Runtime.NotifyAll(transport);
			}
		}