I'm writing a Windows service for a company I work for that needs to open multiple connections using various secure protocols (depends upon the destination's requirements).

This product seems really good.

I have almost the entire thing written and tested using another product and lo-behold, it won't run as a service.

First Question:
Will these components run under a program running as a service?

The example under SophisticatedClient appears to be the closest to what I need in terms of functional example, but I note the get and put buttons don't have any code associated with them. Before I can commit to buying this product, I'll need to prove that it works (even if slowly due to the limitation) by uploading and downloading some files.

Next Q:
Is there a post or article that gives a code example on how to use the Async functionality to get and put files that I use? It doesn't need to be functional, but should have all of the parts involved such as getting the proper handles and reading/writing loop and closing the file.

There are a lot of parts to this using the Async functionality and, while I'm sure I can figure it out over time, time is somewhat short already and I could sure use a functional example to build from.

Next Q:
How does one interrupt a download?

I don't see any type of abort function, so I'm assuming that I check for the need to abort after a read. But what if, for some reason, things get hung up? How do I abort the current operation cleanly? Do I just issue a disconnect type function?

Next Q:
Is there a way to interrupt a download/upload if I use the simpleclient?

The only real async part I need is during the upload/download and if that's interruptable (cleanly) then I can probably use the simple client and save me a lot of work.

Next Q:
I'm sure I'll have more when I get into this, but for now the above will suffice.

I'm actually considering the suite of products included in the SecureBlackbox Standard. The product that I need at this moment is the SFTPBlackbox client-server. Next on the horizon is to be able to do PGP over FTP. I suspect other variations will come up.

The company I'm doing work for has already purchased your BizCrypto for BizTalk, but I need a .net product that will do secure ftp (SFTP2 and up). I found one product that does SFTP3, but after I bought it found it doesn't do SFTP2. Some of our clients still use that so I made a mistake that I'm going to have to eat.

Our FTP component (TElSimpleFTPSClient) works only in synchronous mode, i.e. the method returns after the operation is complete. Most commonly used SFTP client, TElSimpleSFTPClient, is also used in synchronous mode.

So to make those components asynchronous you need to move them to a separate worker thread.

All of those components can work in a service, and they often do. Evaluation version, however, sometimes shows a nag screen, and if this happens in a service, you can't close it (as you don't see a window) and execution stops. To request a time-limited key which removes the nag screen, use key request form.

You can interrupt the client by setting the parameter in OnProgress event. Also you can call Close(true) method which will forcefully close the socket and any pending operation will be cancelled.

I'm already multi-threaded (one thread for each direction per location). The nag screen is not a problem initially as I can run the program as console or service. I'll just test under the console form until I have something, then I can get the time-limited key for the final test as a service.

I think I hear you saying that with the SIMPLE client I can run the upload/download on one thread and a monitor thread can do one of two things if I need to interrupt the transfer:

1) The monitor thread can set a flag that the OnProgress callback can interrogate and if set the OnProgress routine can specify to cancel. I take it the OnProgress routine is called for every block of data transferred? That would be satisfactory.

2) if the upload/download hangs for any reason, I can call the .close() method on the applicable object from the monitor thread to terminate the transfer.

Is this correct? I'm too tired tonight to cobble something together, but it does sound like it will work.

I'll be sending an email to sales here directly inquiring on pricing options.

Greg wrote:
I take it the OnProgress routine is called for every block of data transferred? That would be satisfactory.

Yes, as described in documentation.

Quote

Greg wrote:
if the upload/download hangs for any reason, I can call the .close() method on the applicable object from the monitor thread to terminate the transfer.

Yes, you can call close method from another thread, but be sure to specify (true) as a parameter to forcefully close the socket. If you specify false in a call from other thread, the component won't like it (transport components are not multithreaded).

I got a chance to play with the Console example and try out some stuff, in particular the termination scenarios above. Worked great.

In the first case, cancelling in OnProgress results in an SBUtils.EElOperationCancelledError exception and that's just fine.

The second case, silently closing the connection resulted in an SBSocket.EElSocketError exception the first time, but not for any other time I tried it. I would have preferred it to trigger the exception every time, but I can check for a hard abort when I return from the transfer.

**NOTE**
You mentioned that

Quote

transport components are not multithreaded

so I must ask a very important question.

Background:
I'm writing a multi-threaded Windows service. Each child thread will be responsible for a single direction to a single destination. Each of these child threads will have some service threads (timers and the like) to handle periodic checks and async file arrival.

Each child thread will have it's own instance of the ElSimpleSFTPClient class and no child thread will interact with the instance of another Child's ElSimpleSFTPClient class. With the exception of the .Close(True) termination example, all interaction with the instance will be by the child's main thread.

Question:
If child "A" needs to cancel it's transfer for any reason (say it's stuck and I need to do a .Close(True)), will this have any impact on any other child which may be running?

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.