protected final void processResult(Object result) {
if (result == null) {
return;
}
RemoteEndpoint.Basic remoteEndpoint = session.getBasicRemote();
try {
if (result instanceof String) {
remoteEndpoint.sendText((String) result);
} else if (result instanceof ByteBuffer) {
remoteEndpoint.sendBinary((ByteBuffer) result);
} else if (result instanceof byte[]) {
remoteEndpoint.sendBinary(ByteBuffer.wrap((byte[]) result));
} else {
remoteEndpoint.sendObject(result);
}
} catch (IOException ioe) {
throw new IllegalStateException(ioe);
} catch (EncodeException ee) {
throw new IllegalStateException(ee);
}
}
PojoMessageHandlerBase.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:apache-tomcat-7.0.57
作者:
评论列表
文章目录