本文整理汇总了Java中org.apache.sshd.server.channel.ChannelSession类的典型用法代码示例。如果您正苦于以下问题:Java ChannelSession类的具体用法?Java ChannelSession怎么用?Java ChannelSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChannelSession类属于org.apache.sshd.server.channel包,在下文中一共展示了ChannelSession类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: data
import org.apache.sshd.server.channel.ChannelSession; //导入依赖的package包/类
@Override
public int data(ChannelSession channel, byte[] buf, int start, int len) throws IOException {
if (decoder != null) {
lastAccessedTime = System.currentTimeMillis();
decoder.write(buf, start, len);
} else {
// Data send too early ?
}
return len;
}
开发者ID:aeshell,项目名称:aesh-readline,代码行数:11,代码来源:TtyCommand.java
示例2: data
import org.apache.sshd.server.channel.ChannelSession; //导入依赖的package包/类
@Override
public int data(ChannelSession channel, byte[] buf, int start, int len) throws IOException {
if (decoder != null) {
lastAccessedTime = System.currentTimeMillis();
decoder.write(buf, start, len);
} else {
// Data send too early ?
}
return len;
}
开发者ID:termd,项目名称:termd,代码行数:11,代码来源:TtyCommand.java
示例3: data
import org.apache.sshd.server.channel.ChannelSession; //导入依赖的package包/类
@Override
public int data(final ChannelSession channel, byte[] buf, int start, int len) throws IOException {
buffer.append(new String(buf, start, len));
for (int i = 0; i < buffer.length(); i++) {
if (buffer.charAt(i) == '\n') {
final String s = buffer.substring(0, i + 1);
final byte[] bytes = s.getBytes(StandardCharsets.UTF_8);
out.write(new ByteArrayBuffer(bytes)).addListener(new SshFutureListener<IoWriteFuture>() {
@Override
public void operationComplete(IoWriteFuture future) {
Session session = channel.getSession();
if (future.isWritten()) {
try {
Window wLocal = channel.getLocalWindow();
wLocal.consumeAndCheck(bytes.length);
} catch (IOException e) {
session.exceptionCaught(e);
}
} else {
Throwable t = future.getException();
session.exceptionCaught(t);
}
}
});
buffer = new StringBuilder(buffer.substring(i + 1));
i = 0;
}
}
return 0;
}
开发者ID:termd,项目名称:termd,代码行数:31,代码来源:AsyncEchoShellFactory.java
示例4: setChannelSession
import org.apache.sshd.server.channel.ChannelSession; //导入依赖的package包/类
@Override
public void setChannelSession(ChannelSession session) {
this.session = session;
}
开发者ID:anand1st,项目名称:sshd-shell-spring-boot,代码行数:5,代码来源:SshSessionInstance.java
示例5: setChannelSession
import org.apache.sshd.server.channel.ChannelSession; //导入依赖的package包/类
@Override
public void setChannelSession(ChannelSession session) {
this.session = session;
}
开发者ID:termd,项目名称:termd,代码行数:5,代码来源:TtyCommand.java
注:本文中的org.apache.sshd.server.channel.ChannelSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论