EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Greetings from Greg

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#11889
Posted: 12/09/2009 10:59:54
by Greg  (Standard support level)
Joined: 12/09/2009
Posts: 20

Hello all,

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.

Thank you all very much for your assistance,
-greg
#11890
Posted: 12/09/2009 11:32:46
by Eugene Mayevski (EldoS Corp.)

Thank you for your interest in our products.

First of all, what exactly components are you asking about? Are you talking about SFTP, FTPS or some other protocol?


Sincerely yours
Eugene Mayevski
#11894
Posted: 12/09/2009 18:40:48
by Greg  (Standard support level)
Joined: 12/09/2009
Posts: 20

Doh!

That was kinda stupid.

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.

-greg
#11895
Posted: 12/10/2009 00:22:12
by Eugene Mayevski (EldoS Corp.)

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.

SophisticatedClient sample uses TElSSHClient + TElSftpClient, which are asynchronous.

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.


Sincerely yours
Eugene Mayevski
#11897
Posted: 12/10/2009 02:44:36
by Greg  (Standard support level)
Joined: 12/09/2009
Posts: 20

This is sounding even better, thank you for your replies.

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.

Thanks,
-greg
#11898
Posted: 12/10/2009 02:57:22
by Eugene Mayevski (EldoS Corp.)

Quote
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).


Sincerely yours
Eugene Mayevski
#11957
Posted: 12/16/2009 00:11:21
by Greg  (Standard support level)
Joined: 12/09/2009
Posts: 20

Hi,

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?

Are the components thread safe when used in this manner?

-greg
#11958
Posted: 12/16/2009 00:51:10
by Eugene Mayevski (EldoS Corp.)

Quote
Greg wrote:
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?


No, this is safe. Instances of the components are completely independent.

Quote
Greg wrote:
Are the components thread safe when used in this manner?


Yes.


Sincerely yours
Eugene Mayevski
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 1946 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!