本文整理汇总了Java中org.apache.sshd.common.io.IoAcceptor类的典型用法代码示例。如果您正苦于以下问题:Java IoAcceptor类的具体用法?Java IoAcceptor怎么用?Java IoAcceptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IoAcceptor类属于org.apache.sshd.common.io包,在下文中一共展示了IoAcceptor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: sshSummary
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
private void sshSummary() {
IoAcceptor acceptor = daemon.getIoAcceptor();
if (acceptor == null) {
return;
}
long now = TimeUtil.nowMs();
Collection<IoSession> list = acceptor.getManagedSessions().values();
long oldest = now;
for (IoSession s : list) {
if (s instanceof MinaSession) {
MinaSession minaSession = (MinaSession) s;
oldest = Math.min(oldest, minaSession.getSession().getCreationTime());
}
}
stdout.format(
"SSH: %4d users, oldest session started %s ago\n", list.size(), uptime(now - oldest));
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:ShowCaches.java
示例2: run
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
@Override
protected void run() throws Failure {
IoAcceptor acceptor = sshDaemon.getIoAcceptor();
if (acceptor == null) {
throw new Failure(1, "fatal: sshd no longer running");
}
for (String sessionId : sessionIds) {
boolean connectionFound = false;
int id = (int) Long.parseLong(sessionId, 16);
for (IoSession io : acceptor.getManagedSessions().values()) {
AbstractSession serverSession = AbstractSession.getSession(io, true);
SshSession sshSession =
serverSession != null ? serverSession.getAttribute(SshSession.KEY) : null;
if (sshSession != null && sshSession.getSessionId() == id) {
connectionFound = true;
stdout.println("closing connection " + sessionId + "...");
CloseFuture future = io.close(true);
if (wait) {
try {
future.await();
stdout.println("closed connection " + sessionId);
} catch (IOException e) {
log.warn("Wait for connection to close interrupted: " + e.getMessage());
}
}
break;
}
}
if (!connectionFound) {
stderr.print("close connection " + sessionId + ": no such connection\n");
}
}
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:34,代码来源:CloseConnection.java
示例3: getBackend
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
private String getBackend() {
IoAcceptor acceptor = daemon.getIoAcceptor();
if (acceptor == null) {
return "";
} else if (acceptor instanceof MinaAcceptor) {
return "mina";
} else if (acceptor instanceof Nio2Acceptor) {
return "nio2";
} else {
return "unknown";
}
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:13,代码来源:ShowConnections.java
示例4: getIoAcceptor
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
public IoAcceptor getIoAcceptor() {
return daemonAcceptor;
}
开发者ID:BruceZu,项目名称:KeepTry,代码行数:4,代码来源:SocketTest.java
示例5: createAcceptor
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
return new NettyIoAcceptor(this, handler);
}
开发者ID:aeshell,项目名称:aesh-readline,代码行数:5,代码来源:NettyIoServiceFactory.java
示例6: createAcceptor
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
@Override
public IoAcceptor createAcceptor(IoHandler handler) {
return new NettyIoAcceptor(factory, handler);
}
开发者ID:aeshell,项目名称:aesh-readline,代码行数:5,代码来源:TestServiceFactory.java
示例7: getIoAcceptor
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
public IoAcceptor getIoAcceptor() {
return daemonAcceptor;
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:4,代码来源:SshDaemon.java
示例8: createAcceptor
import org.apache.sshd.common.io.IoAcceptor; //导入依赖的package包/类
@Override
public IoAcceptor createAcceptor(FactoryManager manager, IoHandler handler) {
return new SharedExecutorMinaAcceptor(executor, ioProcessor, manager, handler);
}
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:5,代码来源:SharedExecutorMinaServiceServiceFactory.java
注:本文中的org.apache.sshd.common.io.IoAcceptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论