Login  
Search All Forums
Dart Home | PowerTCP Server for ActiveX | Custom Development Reply | PowerTCP Server for ActiveX Topics | Forums   
AuthorForum: PowerTCP Server for ActiveX
Topic: FTP Server not validating logins if an error occurs
cdeutmeyer

From: Dubuque, IA USA
Posts: 8
Member Since: 08/27/02
posted March 8, 2006 10:46 AM

Similar to [FTP-Server still runs after program quits] post

If FTP Server (VB app) encounters an error and is sitting there with the error message up, the server control continues to run.

None of the events are firing while the app is in this state. The server will accept any login attempt regardless of the user name and password because the authentication code is in the Login event that’s not firing.

I can easily reproduce this problem all day long with a few lines of code and Windows command FTP client.

I would be happy if the ftp server operation was suspended somehow instead of just continuing to operate.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 8, 2006 10:55 AM

You can't put a VB message box up inside one of the events. The messagebox blocks the thread inside the event and since the events are non-reentrant, the events that come in are queued up.

You should change the way that you report info in the events. If you show a form in non-modal mode you should not have this problem.
cdeutmeyer

From: Dubuque, IA USA
Posts: 8
Member Since: 08/27/02
posted March 8, 2006 11:06 AM

The error can occur outside of any server control events. For example: 

1 Start the server.
Private Sub Command1_Click()
  FtpServer1.Start "c:\", , "172.16.100.39"
End Sub

2. an error occurs somewhere in the program
Private Sub Command2_Click()
  Err.Raise 150
End Sub

3 Now login freely without the login event being fired.

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 8, 2006 11:46 AM

Unfortunately, there isn't much we can do about that. What you are doing is forcing an unhandled exception, which causes VB to display the modal msgbox. If you think a section of code could cause an exception it should be inside an OnError block.
cdeutmeyer

From: Dubuque, IA USA
Posts: 8
Member Since: 08/27/02
posted March 8, 2006 11:55 AM

OK.

BTW - I have to say that you guys are on top of this forum. Very fast turnaround.

Thanks!

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted March 8, 2006 11:57 AM

Glad I could help
Reply | PowerTCP Server for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX