| Dart Home | PowerTCP FTP for ActiveX | Custom Development | Reply | PowerTCP FTP for ActiveX Topics | Forums |
| Author | Forum: PowerTCP FTP for ActiveX Topic: Error 10057 |
| vulcanbomber miles@aykroyd.co.uk From: SCUNTHORPE, United Kingdom Posts: 14 Member Since: 08/03/04 |
posted November 28, 2006 6:52 AM I have created a VB6 app that works fine (Windows XP). I have added a Cancel button together with the following code: Private Sub cmdAbort_Click() ipCancel = True Ftp1.Abort Unload Me End Sub If I start a download and click on the Cancel button I get a 10057 error as follows: By placing Msgbox comments in the code I can see that as soon as the Ftp1.Abort command has taken place I get "Run-time error 10057. Receive or send method failed. The socket is not connected." Any suggestions as what I can do to avoid the error message. Regards Miles Aykroyd |
| vulcanbomber miles@aykroyd.co.uk From: SCUNTHORPE, United Kingdom Posts: 14 Member Since: 08/03/04 |
posted November 28, 2006 11:44 AM I have done some further tests! When I switch on trace I get: 200 Type set to BINARY 213 25825700 227 Entering Passive Mode (192,168,0,4,4,0). 150 Opening BINARY mode data connection for file transfer. And when I display an error mesage it states: "Unexpected protocol error:FATAL", and then I get the 10057 error message displayed. I hope that helps. Regards Miles |
| Amit From: Rome, NY USA Posts: 315 Member Since: 03/15/06 |
posted November 28, 2006 2:42 PM Hello Miles, Regarding this error message, I would suggest you to use the AbortCommand method. You may also take a look at our ListView sample project which uses this method. Here is the location of this sample project: C:\Program Files\PowerTCP\FTP Tool\Samples\Vb6\ListView This method gracefully aborts the last command sent by sending ftpAbort command. The server will abort the current command in progress (if any), and will then accept new commands. Please model your application to use this method and then do let us know your observations on this issue. I hope this is of help. Regards, Amit |
| vulcanbomber miles@aykroyd.co.uk From: SCUNTHORPE, United Kingdom Posts: 14 Member Since: 08/03/04 |
posted November 29, 2006 3:36 AM Hello Amit I have done as you suggested, and now I get a "Run-time error 11103. Session aborted.". I have added: Ftp1.AbortCommand MsgBox "State " & Ftp1.State just to see what the state was after the AbortCommand, and it returns a 2. Is there a way to suppress the error message? Regards Miles |
| Amit From: Rome, NY USA Posts: 315 Member Since: 03/15/06 |
posted November 29, 2006 2:06 PM Hi Miles, You just need to handle this error appropriately as we have done in our ListView sample. Please take a look at this sample and if you still find any issues in handling these error messages, do let me know. Here is a small example of handling this error: Private Sub Command1_Click() On Error GoTo onerror 'Login to the FTP Server 'Ftp1.Login "ServerName", "Username", "Password" 'Store a file Ftp1.Store "RemoteFileName", "LocalFileName" Exit Sub onerror: Debug.Print End Sub Private Sub Command2_Click() Ftp1.AbortCommand End Sub Also note that AbortCommand will return State as 2, because the server has only aborted the current command in progress and the server is ready for receiving further commands from client. Regards, Amit |
| vulcanbomber miles@aykroyd.co.uk From: SCUNTHORPE, United Kingdom Posts: 14 Member Since: 08/03/04 |
posted November 30, 2006 5:16 AM Finally solved the problem - I had placed the error trapping in the wrong place!!!! Thanks for your assistance. Miles |
| Amit From: Rome, NY USA Posts: 315 Member Since: 03/15/06 |
posted November 30, 2006 1:18 PM Hi Miles, It is nice to hear that the response was helpful. Do let us know if you require further assistance/ clarifications. Regards, Amit |
| Reply | PowerTCP FTP for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|