EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleSFTPClient Open method causes 100% cpu usage

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#13040
Posted: 04/20/2010 16:33:23
by Nathan Duncanson (Basic support level)
Joined: 04/20/2010
Posts: 2

When calling the Open method of the SBSimpleSftp.TElSimpleSFTPClient object, the currently running thread immediately exits and the webserver consumes 100% of the cpu cycles of one processor core. If the method is called a second time without restarting the webserver, the next available core is also brought to 100% cpu utilization. No errors are thrown - at least that I can catch using Try-Catch blocks at any point on the call stack.

I'm using version 7.1 of Secure Black Box, in an VB/ASP.Net 3.5 application.

Relevant code:
Code
    Sub Run()

        Dim localFileName As String = "xxxxxxx.csv" 'local path and filename
        'code to create the file to be sent.

        Dim sftpClient As New SBSimpleSftp.TElSimpleSFTPClient
        AddHandler sftpClient.OnKeyValidate, AddressOf sftpClient_OnKeyValidate
        SBUtils.Unit.SetLicenseKey("xxxxxx")

        Try

            Dim remoteFilePathAndName As String = "xxxxx.txt" ' remote directory path and filename

            sftpClient.Address = FtpUri
            sftpClient.Port = FtpPort
            sftpClient.Username = FtpUserName
            sftpClient.Password = FtpPwd
            sftpClient.ASCIIMode = True
            sftpClient.UseInternalSocket = True

'The problem occurs here.
            sftpClient.Open()
'Code after this is never executed and breakpoints are skipped.

            sftpClient.UploadFile(localFileName, remoteFilePathAndName, TSBSFTPFileTransferMode.ftmOverwrite)

            sftpClient.Close(True)
        Catch ex As Exception
            Common.Log.Error(ex.Message)
        Finally
            If sftpClient.Active Then
                sftpClient.Close(True)
            End If
        End Try
    End Sub


    Private Sub sftpClient_OnKeyValidate(ByVal Sender As Object, ByVal ServerKey As SBSSHKeyStorage.TElSSHKey, ByRef Validate As Boolean)
        Validate = True
    End Sub
#13042
Posted: 04/21/2010 00:07:16
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

Could you please provide us a little more details about the issue:

1) Are OnKeyValidate, OnError, OnAuthenticationFailed and OnAuthenticationSucceeded events invoked?
2) Does the code work if executed from a generic .NET application (not from an ASP.NET one)?
#13058
Posted: 04/21/2010 08:33:53
by Nathan Duncanson (Basic support level)
Joined: 04/20/2010
Posts: 2

Quote
1) Are OnKeyValidate, OnError, OnAuthenticationFailed and OnAuthenticationSucceeded events invoked?

I did not check OnKeyValidate, however when creating and assigning handlers for the other three events my breakpoints were not hit nor did the logging code within them execute.

Quote
2) Does the code work if executed from a generic .NET application (not from an ASP.NET one)?

I have not yet tried this. However I tried using both IIS on my local machine as well as using the Visual Studio web server. I had the same results on both, although different processes got hung up (IIS: ASP.Net work process got hung; VS Dev Server: The Dev Server process got hung.)

When I have time, I may be able to create a simple console app to test the component.

Reply

Statistics

Topic viewed 1163 times

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




|

Back to top

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

Got it!