Component Busy (General questions)
Dear Mr/Mrs,
I think this is discussed in the past but I can't find the right solution for my problem: I've build a kind of message-broker for my company with transfers 1000s of files per day from many sources to many destinations. It ran for about one year without any crashes! But recently I've addes some sources where a FTP-server from Serv-U is installed (4.1). Since then my application sometimes halts with a component busy messagebox.
I use the following code in my application:
With objFTP
If .State = Connected Then .Disconnect
.HostName = <IPadres>
.Login = <loginname>
.Password = <password>
.Timeout = 60
If <securesetting> Then
.Protocol = SFTP
Else
.Protocol = FTP
End If
.Blocking = True
.Connect
etc
end with
How can I get rid of the messagebox? I can live with an error (execption handling is build into the application), but I can't live with an application that halts because of a messagebox.
Thanks in advance,
Kind regards,
Rien van Ham
Re: Component Busy
Hi Rien,
You should put error handling at Connect Method. In Blocking mode commands are executed line by line. If some error occur that error will be returned immediately.
If I understand you correctly error occur on Connect Method. So you should use there error handling.
You are receiving component busy error. Is this something we can duplicate on our side? This is much old version of Serv-U server. Can we maybe connect to your server and duplicate this problem?
You can send your private information to techsupport@weonlydo.com
Regards,
Drazen
Re: Component Busy
Hello Drazen,
I'm sorry, but I don't understand you fully.
The method, in which the .connect method takes place has error handling:
Sub ZetconnectieOp
On error goto subError
bla bla
.connect
bla bla
subError:
LogToFile err.number & - & err.description
End sub
Is this what you mean?
Unfortunatly you can't connect to our servers (There all in a protected area) and the annoying thing it that 100s of times no problem occurs but sometimes it does (and off course in the middle of the night .
Thank you again,
Rien van Ham
Re: Component Busy
Rien,
This shouldn't happened. Is your full wodFtpDLX code under error handling (On Error GoTo subError)?
Did you maybe set Blocking Property to False somewhere in your code?
You are using VB6 right?
Drazen
Re: Component Busy
Hello Drazen,
No, I only set the blocking property once (just before the connect method) and yes, I'm (still) using VB6 and wodFTPDlx version 2.9.2.
Regards,
Rien
Re: Component Busy
Hello Drazen,
I just implemented two extra loggings into my application just before and after the connect method:
NeemMeldingOp Before Connect
Connect
NeemMeldingOp After Connect
so that we can see if the connect is blocked at the time of the Component Busy messagebox.
Regards,
Rien
Re: Component Busy
Rien,
It would be best that you determine exact line where error occur. Can you maybe make such debug application?
Drazen
Re: Component Busy
Hallo Dazen,
I wrote some extra logging in the application. Tonight no errors were detected so all the six(!) instances of my application are running at this moment. I will write here part of the logging after I've seen the component busy error again. It may take a few days because in the weekend the company is closed.
Kind Regards,
Rien
Re: Component Busy
Hallo Dazen,
Today I wrote some extra logging because the current logging doesn't give any extra information. This weekend the application stalled again with a component busy messagebox and these are the last lines what is logged:
2407 222536 398 Before Connect
2407 222536 617 Event CONNECTED fired
2407 222536 617 Connectie opgezet (in english: connection established)
2407 222536 617 After Connect
2407 222637 398 Event DONE fired
(here stopped the application)
After the connect the LISTDIR method is called so perhaps we have the find the problem there. I added today Before ListDir and After ListDir comments to the code so let's see if the LISTDIR method is the last method which is executed.
Thanks in advance,
Rien
Re: Component Busy
Rien,
Where did you call ListDir Method in your code? Are you maybe using wodFtpDLX Events and execute methods there?.
Drazen
Re: Component Busy
Hello Dazen,
The LISTDIR method is called outside the eventhandler (after the CONNECT method) but the POPULATETREE method (with the DIRITEMS collection as argument) was called inside the DONE event.
Today I moved the the call to the POPULATETREE method outside the DONE event and let's see if that solves the problem.
Thanks in advance,
Rien
Re: Component Busy
Rien,
That could solve your problem. You can put that code just after ListDir Method because in blocking mode commands are executed line by line.
wodFtpDLX will go to next line in your code only when previous line is finished with execution.
Let us know how it goes.
Drazen
Re: Component Busy
Hello Dazen,
Last night I didn't experience any problems; so let's hope my problem is solved now. I will contact you again if the problems comes back.
Thank you very much for your help.
Regards,
Rien
Re: Component Busy
Hello Dazen,
I would like to thank you very much. My problem is solved.
The lesson is:
Do not call any methods of the WodFtpDlx DLL within an event.
Kind regards,
Rien
Re: Component Busy
Hi Rien,
I'd just like to point out that this is correct only when using Blocking mode (Blocking property set to true).
When you use component in non-blocking mode, events *HAVE* to be used for calling methods.
Regards,
Damba