Close session without destroying object
Hi,
I am trying to use the Winscp.net assembly into an existing file transfer program written in vb.net.
I am wondering why no Close method exists inside the Session class to close the current session without disposing the complete object. Sometimes it is useful to close a session and reopen it again with other credentials.
To make some tests I have added a Close method to the source code of the assembly. It looks like this:
public void Close()
{
using (Logger.CreateCallstackAndLock())
{
Cleanup();
}
}
Any comments if this is suitable? Or do you see any bad side effects?
Best,
Michael
I am trying to use the Winscp.net assembly into an existing file transfer program written in vb.net.
I am wondering why no Close method exists inside the Session class to close the current session without disposing the complete object. Sometimes it is useful to close a session and reopen it again with other credentials.
To make some tests I have added a Close method to the source code of the assembly. It looks like this:
public void Close()
{
using (Logger.CreateCallstackAndLock())
{
Cleanup();
}
}
Any comments if this is suitable? Or do you see any bad side effects?
Best,
Michael