EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How do I create a TunnelList?

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#370
Posted: 06/01/2006 13:16:25
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

I want to create an SSHTunnelList for SSHClientX::SetTunnelList but I don't see any method of adding an SSHTunnelConnection to it. Can you give me some guidance please.
#371
Posted: 06/01/2006 13:46:59
by Ken Ivanov (EldoS Corp.)

ElSSHTunnelConnectionX objects are created by ElSSHClientX control, so you do not need to create them manually. Please call ElShellSSHTunnelX.Open() method to initiate session establishing. As soon as the session is established, ElShellSSHTunnelX object fires OnOpen event, passing the created ElSSHTunnelConnectionX instance as a parameter.
#373
Posted: 06/01/2006 18:45:12
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

Sorry if I'm sounding a bit obtuse here, I've never worked with ActiveX controls before.

Anyway, I created a CElCustomSSHTunnelX control but there does not appear to be an Open() method. Also, how does this control know about the CElSSHClientX control?
#374
Posted: 06/02/2006 00:34:27
by Ken Ivanov (EldoS Corp.)

Quote
Anyway, I created a CElCustomSSHTunnelX control but there does not appear to be an Open() method
.
Hmm, it seems that ActiveX control wizard has more bugs than we expected. When creating wrappers for components, it declares methods only of the default interface of the control (ignoring all other interfaces). So if you need to access methods of non-default interface, you should explicitly request this interface using QueryInterface method and then call its methods.

Unfortunately, the only thing we can recommend is to avoid using the control wizard (i.e., to create the components in run-time). SecureBlackbox distribution includes the corresponding wrappers (.h and .c files). It may look like the following:
Code
IElShellSSHTunnelX* tunnel = NULL;
if (FAILED(CoCreateInstance(CLSID_ElShellSSHTunnelX, NULL, CLSCTX_INPROC_SERVER, IID_IElCustomSSHTunnelX, (void**)&tunnel))) {
  // failed to create the tunnel
}

IElSSHTunnelListX* list = NULL;
if (FAILED(CoCreateInstance(CLSID_ElSSHTunnelListX, NULL, CLSCTX_INPROC_SERVER, IID_IElSSHTunnelListX, (void**)&list))) {
  // failed to create the tunnel list
}

// binding tunnel to tunnel list
tunnel->put_TunnelList(list);


Quote
Also, how does this control know about the CElSSHClientX control?

ElSSHTunnelListX object should be also bound to ElSSHClientX object. Please consider using ElSSHClientX.put_TunnelList method (or ElSSHClientX.SetTunnelList if you are creating components by putting them on a dialog).

Actually, you can avoid dealing with tunnels and tunnel lists at all. If you need just a simple SSH functionality (e.g., to run a shell or command), you can use ElSimpleSSHClientX control, which is much more easier to use. Moreover, ElSimpleSSHClientX contains a built-in socket, so you will not need to deal with third-party socket implementations.
#409
Posted: 06/07/2006 13:08:56
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

Thanks for your help so far, I'm making progress. However, I don't know how to handle events from the ElSSHTunnelConnectionX since I did not create it. I need to add an entry to the event map but what Object ID do I use for this?
#415
Posted: 06/07/2006 18:54:31
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

OK never mind. I feel like I'm trying to crack a walnut with a sledge hammer. I think I'll try the ElSimpleSSHClientX instead as you suggested. I didn't want to use the internal socket as its a blocking socket, so I'll have to use my own socket.

Thanks anyway.
#416
Posted: 06/07/2006 23:11:56
by Mike Scriven (Standard support level)
Joined: 05/19/2006
Posts: 102

Well that won't work either. If there is no data available from the socket I return zero in ElSimpleSSHClient::OnReceive but it look like OnReceive is just called repeatedly looking for data.

How can I make this work asynchronously? A DataAvailable method in ElSimpleSSHClient would solve this I think.

Thanks
#423
Posted: 06/09/2006 03:20:29
by Ken Ivanov (EldoS Corp.)

Quote
How can I make this work asynchronously? A DataAvailable method in ElSimpleSSHClient would solve this I think.

ElSimpleSSHClient was designed as a synchronous component. The best way to use it is to run it in a separate thread. That's why the DataAvailable() method is not published -- the component calls it internally until some operation (e.g., Open(), Receive()) is completed.
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

Topic viewed 5016 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!