Login |  Register  
Search All Forums
AuthorForum: PowerTCP FTP for .NET
Topic: Error after .Close command
phlexss

From: Waalwijk, Netherlands
Posts: 31
Member Since: 03/17/04
posted March 22, 2017 4:52 AM

Hi,

I'm using FTP for .Net v4.7.2. and I'm having the following problem:

when connecting to a "StingRay FTP Server 3.0.2" server a timeout and error occurs after closing the connection. All goes well up unto the .Close command.

This is what the tracelog says:

[22-3-2017 09:49:54.4538046] <--- 150 File status okay; about to open data connection.
[22-3-2017 09:49:54.4568079] <--- 226 Closing data connection. Requested file action successful.
[22-3-2017 09:49:54.5264933] ---> QUIT
[22-3-2017 09:49:54.5806761] <--- 221 Good bye and have a nice day ;-)

But my program then hangs and throws the following exception after 30 seconds:

"InnerException thrown before end of stream."

What could be the problem and how to fix it?

Thanks for any help.
Nick B (Admin)

From: Utica, NY USA
Posts: 553
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted March 22, 2017 12:39 PM

Hello,

This suggests that your server is not closing the connection after receiving the QUIT command (our component waits for the server to close the connection, as Close() is used to gracefully shutdown the connection (and also returns the server's response)), per RFC959:

LOGOUT (QUIT)
This command terminates a USER and if file transfer is not in progress, the server closes the control connection.

The hang is most likely because the Close() is called on the UI thread.

You could use Abort(), or contact the manufacturer of the server and report this bug.

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

phlexss

From: Waalwijk, Netherlands
Posts: 31
Member Since: 03/17/04
posted March 23, 2017 3:52 AM

Hi Nick,

Thanks for the quick reply.

But doesn't the message:

"[22-3-2017 09:49:54.5806761] <--- 221 Good bye and have a nice day ;-)"

...suggest that the server correctly receives and handles the .Close command!?

Ans why the "InnerException thrown before end of stream."?

.Abort does indeed terminate the connection without an error but it's not the most elegant option.
Jamie Powell (Admin)

From: Rome, NY USA
Posts: 365
Member Since: 03/13/07

Extra Support Options
Custom Application Development

posted March 23, 2017 3:09 PM

The message only means the server recognizes the QUIT, but does not mean it is being handled correctly by closing the server side of the connection.

The exception likely contains an inner exception indicating a timeout.

If you have any further questions, please email me directly at jamie.powell@dart.com.

Regards,
Jamie
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX