android sdk 3.7.5版本发布

1 protobuf版本切换为protubof-lite
This commit is contained in:
远方夕阳 2019-11-13 15:44:42 +08:00
parent 19cff7ef19
commit 91cde7abed
15 changed files with 1292 additions and 2483 deletions

View File

@ -6,9 +6,9 @@ CIM是基于mina或者netty框架下的推送系统我们平常使用第三
侣信专业版是基于CIM面向中小企业和者各类团队组织内部交流使用工具。具有丰富的功能聊天群组部门组织内部朋友圈等功能。它可以在局域网内使用保证沟通的信息安全并且它是完全免费的而且可以及时获得更新。
## [http://farsunset.com](http://farsunset.com)
<div align="center">
<img src="https://images.gitee.com/uploads/images/2019/0403/110400_b83d0906_58912.jpeg" width="280px" />
<img src="https://images.gitee.com/uploads/images/2019/0403/110400_6883aa1b_58912.jpeg" width="280px" />
<img src="https://images.gitee.com/uploads/images/2019/0403/110401_6d0679f4_58912.png" width="280px" />
<img src="http://staticres.oss-cn-hangzhou.aliyuncs.com/hoxin/session.jpg" width="280px" />
<img src="http://staticres.oss-cn-hangzhou.aliyuncs.com/hoxin/contacts.jpg" width="280px" />
<img src="http://staticres.oss-cn-hangzhou.aliyuncs.com/hoxin/moment_timeline.jpg" width="280px" />
</div>
---
@ -73,5 +73,10 @@ CIM是基于mina或者netty框架下的推送系统我们平常使用第三
5.修正文档中一些疏漏
-------------------------------------------------------------------------------------------
版本:3.7.5/时间:2019-11-13
1.android sdk 优化使用protobuf-lite版本替代较为臃肿的protobut-java版本

View File

@ -51,6 +51,7 @@
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
<property name="show.migrate.to.gradle.popup" value="false" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
@ -116,6 +117,8 @@
<workItem from="1563191907066" duration="17000" />
<workItem from="1563245165817" duration="382000" />
<workItem from="1566816214034" duration="698000" />
<workItem from="1567410257659" duration="115000" />
<workItem from="1568597528002" duration="523000" />
</task>
<servers />
</component>

View File

@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="libs/protobuf-java-3.7.0.jar"/>
<classpathentry kind="lib" path="libs/android.jar"/>
<classpathentry kind="lib" path="libs/protobuf-lite-3.0.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -39,8 +39,8 @@ public class CIMLoggingFilter extends IoFilterAdapter {
@Override
public void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) {
logger.info("EXCEPTION" + getSessionInfo(session) + "\n{}", cause.getClass().getName());
session.closeOnFlush();
logger.error("EXCEPTION" + getSessionInfo(session) + "\n{}", cause);
nextFilter.exceptionCaught(session, cause);
}
@Override

View File

@ -54,9 +54,16 @@ public class CIMNioSocketAcceptor extends IoHandlerAdapter implements KeepAliveM
private CIMRequestHandler outerRequestHandler;
private IoAcceptor acceptor;
private int port;
private final int IDLE_TIME = 120; //
private final int TIME_OUT = 10; //
private final int READ_BUFFER_SIZE = 1024; // byte
/*
* 读写空闲2分钟后 服务端 -> 客户端 发起心跳请求
*/
private final int IDLE_HEART_REQUEST_TIME = 120;
/*
* 发起心跳后等待客户端的心跳响应超时10秒后断开连接
*/
private final int HEART_RESPONSE_TIME_OUT = 10;
private final int READ_BUFFER_SIZE = 1024;
public void bind() {
@ -70,9 +77,9 @@ public class CIMNioSocketAcceptor extends IoHandlerAdapter implements KeepAliveM
((DefaultSocketSessionConfig) acceptor.getSessionConfig()).setKeepAlive(true);
((DefaultSocketSessionConfig) acceptor.getSessionConfig()).setTcpNoDelay(true);
KeepAliveFilter keepAliveFilter = new KeepAliveFilter(this, IdleStatus.WRITER_IDLE);
keepAliveFilter.setRequestInterval(IDLE_TIME);
keepAliveFilter.setRequestTimeout(TIME_OUT);
KeepAliveFilter keepAliveFilter = new KeepAliveFilter(this, IdleStatus.BOTH_IDLE);
keepAliveFilter.setRequestInterval(IDLE_HEART_REQUEST_TIME);
keepAliveFilter.setRequestTimeout(HEART_RESPONSE_TIME_OUT);
keepAliveFilter.setForwardEvent(true);
ExecutorService executor = Executors.newCachedThreadPool(runnable -> {
@ -159,6 +166,12 @@ public class CIMNioSocketAcceptor extends IoHandlerAdapter implements KeepAliveM
public boolean isResponse(IoSession arg0, Object arg1) {
return arg1 instanceof HeartbeatResponse;
}
@Override
public void exceptionCaught(IoSession session, Throwable cause) {
}
public Map<Long, IoSession> getManagedSessions() {
return acceptor.getManagedSessions();

View File

@ -26,5 +26,5 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.protobuf:protobuf-java:3.7.0'
implementation 'com.google.protobuf:protobuf-lite:3.0.0'
}