Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.6k views
in .NET FTP by (160 points)
I've bet the farm on using EDTFTP/.NET (V1.2.5) the free version, for a complex multi FTP upload program for upgrading mobile radio networks.

It's multi-threaded but each thread maintains it's own FTPConnection, it works fine and I limit the number of concurrently active threads to five, it works fine,
EXCEPT about once a week the FTP upload doesn't seem to fire the BytesTranferred events and my application hangs and consumes a large amount of system
memory, there's nothing to do but kill it, upon executing again it works.

I assume the problem is in my code, but this is so hard to debug as it happens only every so often so I'd just thought I'd post here in the hope someone
has any idea what is happening or has had a similar experience.

I naturally am assuming the problem is in my code, it appears that on very rare occasions I loosed the event binding, here's the code:

m_BsrFTPConnection->BytesTransferred += new BytesTransferredHandler( pDspTx, &CDspTx::UpdateTransferProgress );

m_BsrFTPConnection->UploadFile( pDspTx->ExecutablePath, pDspTx->ExecutableName );

m_BsrFTPConnection->BytesTransferred -= new BytesTransferredHandler( pDspTx, &CDspTx::UpdateTransferProgress );

My code in C++ using Framework 1.1.

The FTPConnection's that I use ConnectMode = FTPConnectMode::PASV

I shall purchase the version with support for the next phase of the project.

2 Answers

0 votes
by (51.6k points)
If an error occurs while UploadFile is executing then an exception is thrown. Have you got an exception handler for these exceptions? To my knowledge we've never had a report of edtFTPnet/Free entering an infinite loop before. I don't really see how it could happen either given that the only loop involved has BufferedStream.Read() as its condition and could therefore only continue infinitely if there was a bug in that class. Is it possible for you to enable logging and store the logs? They might give us some clues as to what is happening.

- Hans (EnterpriseDT)
0 votes
by (160 points)
O dear, head hung low, many apologies, it was my fault, I was not only performing uploads in various threads but erroneously I was creating a logger in each thread, there was a file contention problem when writing a log.

I now create a single logger and it is shared by the upload threads.

So good news for me in that this difficult error to find has now been found.

Phew I was getting very worried there as the release close date is today.

Thanks.

Categories

...