Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Situation 1)
I needed to change MINA send and receive buffer sizes for sockets, because I couldn't get bandwidth over 3.0 MiB/s using SSHD with the default sizes. For that I needed the IoAcceptor used by SshServer. The object oriented solution would have been to subclass SshServer and override start() with
public void start() {
super.start()
((DefaultSocketSessionConfig)acceptor.getSessionConfig()).setReceiveBufferSize(1024*1024);
((DefaultSocketSessionConfig)acceptor.getSessionConfig()).setSendBufferSize(1024*1024);
}
But since IoAcceptor is private and not protected, I had to create a wrapper class that has its own IOAcceptor. Very kludgy. I couldn't find any other way to get at the accessor. Also the setup default method in SshServer is static. Maybe it should be done by the empty constructor instead?
Situtation 2)
Wanted to extend ScpCommand for wildcard support and some other functionality, but all the read and write functions were private instead of protected. Ended up copying the entire class and rewriting it for my own purposes.