EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Posted: 02/15/2012 07:36:56
by Arne  (Standard support level)
Joined: 02/15/2012
Posts: 1

I'm trying to work with the SSH / SFTP server sample.
But I have 2 questions.

1) When looking at the code when the connection is closed there actually is a add handler statement.
SSHSession.vb / CleanUp
AddHandler m_SSHServer.OnSend, AddressOf SSHServer_OnSend

I'm not sure i understand the reason why there is added a handler when we do the clean up, i would probably have guessed a remove would have been required. But it's probably just me.

2) I'm trying to handle some additional file tings in the SFTP layer. The SSH Layer is also sending a Close event. But the close is never sent/handled to the SFTP layer. And since I was trying to do some additional file handling in the SFTP layer (It's where I know what files have been send), i would have loved to do some additional file handling when the connection is closed. Now it seems i have to store the SFTP session object, and then use it during the SSH close, and i would have loved to avoid that.
Since there in the SFTP object already is some code for the Close event.

Anny suggestions why the close not is fired in the SFTP Layer?
Posted: 02/15/2012 08:23:33
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 442

1) Handler is added since it can be removed before, when there are some problems with connection (socket closed, whatever else), since server may try to send some data before get finally closed
2) It seems that there is a problem in demo or SFTPHandler, it should handle handler.OnDisconnect event. Also possible reason is that connection is not closed gracefully - so message about closing SFTP channel doesn't get to the server.

Please note, that this server is just a demo, so it should not be used in production environment.



Topic viewed 563 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!