Forget a) - I grabbed the trunk revision and built that, and it is way better
than the 0.5.0 release...assuming this is due largely in part to this code in
SshServer.java: I'm using 0.7.0-SNAPSHOT -- aside from the usual disclaimers
that go with SNAPSHOT releases...is there anything major in the trunk that I
should be worried about? The SftpTest.java does not pass for me.
// MINA itself forces our socket receive buffer to 1024 bytes
// by default, despite what the operating system defaults to.
// This limits us to about 3 MB/s incoming data transfer. By
// forcing back to the operating system default we can get a
// decent transfer rate again.
//
final Socket s = new Socket();
try {
try {
nio.getSessionConfig().setReceiveBufferSize(s.getReceiveBufferSize());
} finally {
s.close();
}
} catch (IOException e) {
log.warn("cannot adjust SO_RCVBUF back to system default", e);
}
I'd still love any pointers on how to do MD5 on the incoming stream and how to
detect when a file is complete.
Regards,
Davis
From: Davis Ford
Hi, I'm looking into building SFTP support into a project with Apache SSHD and
JSch. I looked at the following unit test from sshd-core as a guideline for
how to do SFTP:
http://svn.apache.org/repos/asf/mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/SftpTest.java
I have a couple quick questions:
a) In the test method testExternal() I set the test to sleep indefinitely so I
could test transfers of variable size files. Using the latest FileZilla
client, I tried sending a file ~150MB and the throughput was less than ideal.
I don't recall the exact numbers, but this is a transfer from localhost to
localhost, and it took several minutes. Is there any way I can boost the
performance to get better throughput?
b) I want to calculate the MD5 on the incoming byte stream for a file, but it
wasn't clear to me how to inject something like an interceptor that can get
a-hold of the input stream in order to do so. Is this possible?
c) Is there an event / callback mechanism to know when a file has been
completely received? In my scenario, the client will be sending multiple files
in one session, and as each file is read and completely written to disk, I need
to trigger an event.
Thanks in advance!
Davis