mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 08:10:55 +03:00
Add a timed join() method to Channel, update Exec example
This commit is contained in:
@@ -272,6 +272,11 @@ public abstract class AbstractChannel
|
||||
close.await();
|
||||
}
|
||||
|
||||
public void join(int timeout, TimeUnit unit)
|
||||
throws ConnectionException {
|
||||
close.await(timeout, unit);
|
||||
}
|
||||
|
||||
protected synchronized void sendClose()
|
||||
throws TransportException {
|
||||
try {
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.schmizz.sshj.transport.TransportException;
|
||||
import java.io.Closeable;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/** A channel is the basic medium for application-layer data on top of an SSH transport. */
|
||||
public interface Channel
|
||||
@@ -138,4 +139,7 @@ public interface Channel
|
||||
void join()
|
||||
throws ConnectionException;
|
||||
|
||||
void join(int timeout, TimeUnit unit)
|
||||
throws ConnectionException;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user