Home » U++ Library support » U++ MT-multithreading and servers » SSH package for U++ (A feature-rich ilbssh2 wrapper for Ultimate++)
Re: SSH package for U++ [message #50145 is a reply to message #50133] |
Tue, 07 August 2018 23:32 |
Oblivion
Messages: 1094 Registered: August 2007
|
Senior Contributor |
|
|
Hello Mirek,
I'll start committing the changes in a couple of days. But before I start I'd like to clear some points and ask for your opinion on some points.
Quote:
SFtpHandle* -> SFtpHandle - if something is "HANDLE", it should not be a pointer to handle.
The thing is, libbsh2 itself returns a pointer to a handle (SFtpHandle is actually an alias for LIBSSH2_SFTP_HANDLE)
I'm reluctant to change that pointer into a real handle as it'll make the things slightly more complex.
However, if we must change the naming I would suggest we use "SFtpObject" instead, since we are dealing with remote file system objects here.
Quote:
Interestingly, it looks like the most important Gets / Puts are missing there
int Get(SFtpHandle h, void *ptr, int size);
bool Put(SFtpHandle h, const void *ptr, int size);
Easy to implement. I'll propose:
int Get(SFtpObject* obj, void* buffer, int size);
String Get(const String& path, int size, int64 offset = 0);
String GetAll(const String& path);
int Put(SFtpObject* obj, const void* buffer, int size);
int Put(const String& path, const String& data, int size, dword flags, long mode);
int Put(const String& path, const String& data, int size, int64 offset = 0);
bool PutAll(const String& path, const String& data);
As for the stream versions of Gets and Puts:
Stream versions come very handy when transferring files > 2GB, and processing the I/O immediately (e.g when filtering).
I've thought about adding SFtpStream variants(eg. SFtpFileIn, SFtpFileOut, etc.) to the package, as you suggessted.
But in the end I concluded that they'll only add another layer of abstraction which can be confusing (as you know, SSH package already has a plenty of classes). Thus I propose to simply rename them and change their parameter order.
E.g.
bool GetStream(const String& path, Stream& out);
bool PutStream(const String& path, Stream& in);
// And other variants...
About the reference examples:
My idea is to create a reference -console- example for each class (SFtp, Scp, SshExec, SshShell, SshTunnel), and have them each contain separate and basic blocking, non-blocking, and multitihreaded code as functions that can be selected/compiled using preprocessor directives.(defs,e.g. BLOCKING, NONBLOCKING, MULTITHREADED). And use these examples as tutorial in Topic++.
What do you think?
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Wed, 08 August 2018 10:51] Report message to a moderator
|
|
|
|
|
SSH package for U++
By: Oblivion on Tue, 14 November 2017 21:59
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 17 November 2017 22:15
|
|
|
Re: SSH package for U++
By: Oblivion on Sat, 18 November 2017 15:57
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 19 November 2017 18:21
|
|
|
Re: SSH package for U++
By: Oblivion on Tue, 21 November 2017 00:38
|
|
|
Re: SSH package for U++
By: koldo on Thu, 23 November 2017 09:07
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 24 November 2017 21:03
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 26 November 2017 09:59
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 01 December 2017 14:35
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: Oblivion on Sat, 02 December 2017 10:44
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: Oblivion on Mon, 04 December 2017 22:46
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: Oblivion on Tue, 19 December 2017 14:27
|
|
|
Re: SSH package for U++
By: Oblivion on Tue, 19 December 2017 14:44
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 07 January 2018 22:09
|
|
|
Re: SSH package for U++
By: koldo on Mon, 08 January 2018 08:27
|
|
|
Re: SSH package for U++
By: Oblivion on Tue, 09 January 2018 23:15
|
|
|
Re: SSH package for U++
By: koldo on Wed, 10 January 2018 08:53
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 19 January 2018 14:18
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 21 January 2018 12:18
|
|
|
Re: SSH package for U++
By: koldo on Sun, 21 January 2018 16:53
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 28 January 2018 12:13
|
|
|
Re: SSH package for U++
By: Oblivion on Mon, 02 April 2018 23:27
|
|
|
Re: SSH package for U++
By: Oblivion on Sat, 07 April 2018 16:25
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 15 April 2018 00:39
|
|
|
Re: SSH package for U++
By: Oblivion on Sat, 21 April 2018 08:12
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: mirek on Tue, 10 July 2018 14:37
|
|
|
Re: SSH package for U++
By: mirek on Tue, 10 July 2018 15:38
|
|
|
Re: SSH package for U++
By: mirek on Tue, 10 July 2018 15:42
|
|
|
Re: SSH package for U++
|
|
|
Re: SSH package for U++
By: mirek on Tue, 31 July 2018 11:07
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 03 August 2018 17:34
|
|
|
Re: SSH package for U++
By: mirek on Fri, 03 August 2018 18:03
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 03 August 2018 18:44
|
|
|
Re: SSH package for U++
By: Oblivion on Tue, 07 August 2018 23:32
|
|
|
Re: SSH package for U++
By: mirek on Wed, 08 August 2018 10:56
|
|
|
Re: SSH package for U++
By: Oblivion on Wed, 08 August 2018 11:22
|
|
|
Re: SSH package for U++
By: mirek on Wed, 08 August 2018 13:28
|
|
|
Re: SSH package for U++
By: Oblivion on Wed, 08 August 2018 14:16
|
|
|
Re: SSH package for U++
By: mirek on Thu, 09 August 2018 11:54
|
|
|
Re: SSH package for U++
By: mirek on Thu, 09 August 2018 12:00
|
|
|
Re: SSH package for U++
By: Oblivion on Thu, 09 August 2018 16:24
|
|
|
Re: SSH package for U++
By: mirek on Thu, 09 August 2018 16:49
|
|
|
Re: SSH package for U++
By: Oblivion on Thu, 09 August 2018 17:03
|
|
|
Re: SSH package for U++
By: Oblivion on Thu, 09 August 2018 17:59
|
|
|
Re: SSH package for U++
By: mirek on Thu, 09 August 2018 18:35
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 12 August 2018 12:51
|
|
|
Re: SSH package for U++
By: Oblivion on Thu, 30 August 2018 07:27
|
|
|
Re: SSH package for U++
By: mirek on Thu, 30 August 2018 09:04
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 31 August 2018 00:12
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 02 September 2018 21:59
|
|
|
Re: SSH package for U++
By: Oblivion on Wed, 31 October 2018 11:00
|
|
|
Re: SSH package for U++
By: Oblivion on Sun, 04 November 2018 19:55
|
|
|
Re: SSH package for U++
By: Oblivion on Fri, 22 March 2019 17:39
|
Goto Forum:
Current Time: Mon Jun 10 10:33:26 CEST 2024
Total time taken to generate the page: 0.02705 seconds
|