Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 #50119 is a reply to message #50070] Tue, 31 July 2018 11:07 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
Oblivion wrote on Wed, 11 July 2018 08:35
Hello Mirek,

Quote:

SSH looks pretty reasonable. Can I move to Core/SSH?


Of course! Smile

Quote:
Put(Stream& in, const String& path);

I would expect path to be the first argument here... Do you insist on this order?


That's because I use "[source], [destination]..." order. I'd prefer it stay that way but I don't insist on it. It can be changed.


Whether the "source, target" or "target, source" is more natural is certainly debatable, however please notice that since the dawn of computer languages the custom is to write target = source (also see strcpy etc... Smile That said, where handle or path is involved, I would probably like to have it as first parameter always.

Besides, it does not seem to be consistent anyway:
bool Get(SFtpHandle* handle, Stream& out);
bool Put(SFtpHandle* handle, Stream& in);

Now I am only scrathich the surface, mostly being interested in SFTP for now. Anyway, seeing that interface, I would probably like to change following things:

SFtpHandle* -> SFtpHandle - if something is "HANDLE", it should not be a pointer to handle.

Instead of:

auto sftp = session.CreateSFtp();

I would like to have

SFtp sftp(session);

Besides, I know that there is some movement to use 'auto' everywhere, but I strongly disagree with that, ESPECIALLY in reference examples.

More important: I thing I would remove whole bunch of Gets and Puts, leave only handle variant in sftp and then add SFtpStream instead. With methods provided in SFtp, it should be easy to do, and it would mostly remove "source/destination controversy".

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);

Anyway, it is now moved to Core/SSH and single example is now in reference - that is another issue I have not solved for now, there is a lot of examples and they really make sense, so maybe I will put them gradually to SSH subfolder.

I am giving you write access to Core/SSH and reference.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WebSockets client in javascript connected to an U++ server sending binary messages
Next Topic: TURTLE high cpu usage, potential security flaw, and client handling problem
Goto Forum:
  


Current Time: Tue Jul 08 23:32:54 CEST 2025

Total time taken to generate the page: 0.03493 seconds