Unhandled exception with listDir() method - WeOnlyDo Discussion board

Unhandled exception with listDir() method (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Alex Bernhard, Wednesday, November 22, 2006, 10:40 (6576 days ago)

Hi

I am using WodFtpDlx.Net 1.1.5. If I call listDir(path) as firts method after connecting, my application crashes indicating an unhandled exception in WodFtpDlx library.

Is this a known issue ?

Alex

Re: Unhandled exception with listDir() method

by wodDamir, Wednesday, November 22, 2006, 10:44 (6576 days ago) @ Alex Bernhard

Hi Alex,

What is the exact exception you get?

Please try setting Blocking Property to true before connecting to server. This will ensure that you have connected to server and then proceed to the next line in your code.

Regards,
Damba

Re: Unhandled exception with listDir() method

by Alex Bernhard, Wednesday, November 22, 2006, 11:33 (6576 days ago) @ wodDamir

Hi

I log all status changes and I invoke the method manually, hence I am sure, that the component is connected to the server.
The exception is system.nullreferenceexception.

Kind regards

Alex

Re: Unhandled exception with listDir() method

by Alex Bernhard, Wednesday, November 22, 2006, 12:25 (6576 days ago) @ Alex Bernhard

Hi again,

My tests indicate, that the method works fine in Blocking mode but not if Blocking = false;

As soon as I e.g. invoke ListNames firts, the subsequent call to listDir() works fine.

Alex

Re: Unhandled exception with listDir() method

by wodDamir, Wednesday, November 22, 2006, 12:36 (6576 days ago) @ Alex Bernhard

Alex,

Can you show me a code snippet of how you call the mentioned Methods?

The Blocking Property needs to be set to True when you are using component in a scripting mode, where code is being executed line-per-line. If you use events to invoke Methods, you don't need the blocking.

I.e:

If you use Connect Method, and make ListDir Call in Connected Event, then you wouldn't need to set blocking property to true.

If you would however use Connect Method, and call ListDir Method right after the Connect, the component would start executing ListDir, although Connect hasn't finished yet. Blocking mode ensures that each method is completed before proceeding to next line in the code.

Regards,
Damba

Re: Unhandled exception with listDir() method

by Alex Bernhard, Wednesday, November 22, 2006, 13:42 (6576 days ago) @ wodDamir

Hi

thank you for your help. In fact, I use weonlydo libraries quite often now and I am very much aware of what 'blocking' mode means, where to set and where not. This shouldn't be the problem.
The point is, that my application allows to call methods synchronosly and asynchronously, depending on the task to do. Therefore, I make use of blocking and events very intensively.

However, I try to write a very simple application for testing purposes.

Alex

Re: Unhandled exception with listDir() method

by wodDamir, Wednesday, November 22, 2006, 14:26 (6576 days ago) @ Alex Bernhard

Alex,

Can you send us a sample application, and we'll try to see if we can help.

You can send the application to techsupport@weonlydo.com

Regards,
Damba

Re: Unhandled exception with listDir() method

by Alex Bernhard, Wednesday, November 22, 2006, 14:46 (6576 days ago) @ wodDamir

Hi

I wrote a simple test applications and I was able to track down the problem, and I must say, sorry for bothering you, it was my fault at the end. I had a bug within my listItem event hadler, therfore it has been indicated as an exception of your component.

Thanks for the support and sorry.

Alex