Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-58

Think of better support for subclassing both SshServer and ScpCommand (and possibly other classes)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.3.0
    • 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.

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            lagergren Marcus Lagergren
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: