Skip to content

Commit

Permalink
v4.0.1发布,修复了若干客户端bug。
Browse files Browse the repository at this point in the history
  • Loading branch information
JackJiang2011 committed May 13, 2019
1 parent ab3de0b commit 4828778
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 70 deletions.
4 changes: 2 additions & 2 deletions ABOUT.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
【工程名称】:MobileIMSDK v4.0, 一个专为移动端开发的原创即时通讯框架,超轻量级、高度提炼,完全基于UDP协议,支持iOS、Android、标准Java平台。
【新版动态】: MobileIMSDK最新v4.0版发布于2019年04月30日
【工程名称】:MobileIMSDK v4.0.1, 一个专为移动端开发的原创即时通讯框架,超轻量级、高度提炼,完全基于UDP协议,支持iOS、Android、标准Java平台。
【新版动态】: MobileIMSDK最新v4.0.1版发布于2019年05月13日
【作者】: Jack Jiang
【QQ】: 413980957
【微信】: hellojackjiang
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* 可与姊妹工程 [MobileIMSDK-Web](http://www.52im.net/thread-959-1-1.html) 无缝互通实现网页端聊天或推送等;:point_left:
* 可应用于跨设备、跨网络的聊天APP、企业OA、消息推送等各种场景。

> MobileIMSDK工程始于2013年10月(2019年04月30日发布了最新版v4.0[版本更新日志点此查看](http://www.52im.net/thread-1270-1-1.html) ),起初用作某产品的即时通讯底层实现,完全从零开发。<br>
> MobileIMSDK工程始于2013年10月(2019年05月13日发布了最新版v4.0.1[版本更新日志点此查看](http://www.52im.net/thread-1270-1-1.html) ),起初用作某产品的即时通讯底层实现,完全从零开发。<br>
MobileIMSDK现已公开并免费供开发者使用,希望对需要的人有所启发和帮助。

:point_right: 您可能需要:[查看更多关于MobileIMSDK的疑问及解答](http://www.52im.net/thread-60-1-1.html)
Expand Down
Binary file modified demos/client/MobileIMSDKDemo-Android.apk
Binary file not shown.
Binary file modified demos/client/MobileIMSDKDemo-Java.jar
Binary file not shown.
Binary file modified dist/client/android/MobileIMSDK4a.jar
Binary file not shown.
Binary file modified dist/client/ios/libMobileIMSDK4iX_common.a
Binary file not shown.
7 changes: 7 additions & 0 deletions release_notes/release_note_v4.0.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

-------------------------------------------------------------------------------------- v4.0.1������2019-05-13 18:00
MobileIMSDK v4.0.1�����˵����

�������Bug��
1. [bug][Android/Java]ȥ����v4.0��������socket.setSoTimeout(..)������ᵼ�·���˵ȶ����ָ����޷��Զ������ع������⣻
2. [bug][Anroid/Java/iOS]�Ż��������㷨�е�һ���߽����⣬������ᵼ�������㷨С�����޷�������ߴ���/֪ͨ�߼�.
2 changes: 1 addition & 1 deletion src_all/demos_src/MobileIMSDK4aDemoX/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
minSdkVersion 14
targetSdkVersion 28
versionCode 104
versionName "v4.0b190430.4"
versionName "v4.0.1b190513.1"
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified src_all/demos_src/MobileIMSDK4aDemoX/app/libs/MobileIMSDK4a.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.openmob.mobileimsdk.android.demo">

<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10" />

<uses-permission android:name="android.permission.GET_TASKS" />

<uses-permission android:name="android.permission.INTERNET" />
Expand Down Expand Up @@ -44,4 +40,4 @@
</activity>
</application>

</manifest>
</manifest>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.0</string>
<string>4.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>b190430.1</string>
<string>b190513.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified src_all/demos_src/MobileIMSDK4jDemoX/lib/MobileIMSDK4j.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void initViews()
mainPanel.addTitledLineSeparator("");
JPanel btnAndVerPanel = new JPanel();
btnAndVerPanel.setLayout(new BoxLayout(btnAndVerPanel, BoxLayout.LINE_AXIS));
JLabel lbVer= new JLabel("v4.0b190430.1");
JLabel lbVer= new JLabel("v4.0.1b190513.1");
lbVer.setForeground(new Color(184,184,184));
btnAndVerPanel.add(lbVer);
btnAndVerPanel.add(Box.createHorizontalGlue());
Expand Down
2 changes: 1 addition & 1 deletion src_all/libs_src/MobileIMSDK4aXOpen/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
minSdkVersion 10
targetSdkVersion 26
versionCode 1
versionName "4.0"
versionName "4.0.1"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected Integer doInBackground(Object... params)
protected void onPostExecute(Integer code)
{
boolean isInitialedForKeepAlive = (lastGetKeepAliveResponseFromServerTimstamp == 0);
if(code == 0 && lastGetKeepAliveResponseFromServerTimstamp == 0)
if(isInitialedForKeepAlive)
lastGetKeepAliveResponseFromServerTimstamp = System.currentTimeMillis();

if(!isInitialedForKeepAlive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,34 +125,10 @@ private void udpListeningImpl() throws Exception
DatagramSocket localUDPSocket = LocalUDPSocketProvider.getInstance().getLocalUDPSocket();
if (localUDPSocket != null && !localUDPSocket.isClosed())
{
/** ## Bug FIX 20190326 [Bug 1, Bug 2] - STAT
## [Bug 20190326_1 描述: 因socket未被释放,导致监听线程无法退出,从而导致OOM的发生]
## [Bug 20190326_2 描述: 因socket未被释放,导致虽手机网络物理连接正常(如WiFi),但不能宽带上网时,导致宽带恢上网后仍不能重连成功]*/
localUDPSocket.setSoTimeout(KeepAliveDaemon.NETWORK_CONNECTION_TIME_OUT + KeepAliveDaemon.KEEP_ALIVE_INTERVAL);
/** ## Bug FIX 20190326[1,2] - STAT */

try{
localUDPSocket.receive(packet);
Message m = Message.obtain();
m.obj = packet;
messageHandler.sendMessage(m);
}
catch(SocketTimeoutException e){
Log.i(TAG, "【IMCORE】【udpListeningImpl】localUDPSocket.receive() 抛出了异常" +
"SocketTimeoutException,应该是socket被close了,本次网络监听阻塞已被解除,socket" +
"监听线程也将正常结束生命周期。。。("+(thread == null ?"":thread.getId())+")");

/** ## Bug FIX 20190326 [Bug 2] - STAT */
try{
if(localUDPSocket != null) {
localUDPSocket.close();
localUDPSocket = null;
}
}catch(Exception ee){
Log.i(TAG, "【IMCORE】【udpListeningImpl】IN localUDPSocket.close(), cause="+ee.getMessage());
}
/** ## Bug FIX 20190326 [Bug 2] - END */
}
localUDPSocket.receive(packet);
Message m = Message.obtain();
m.obj = packet;
messageHandler.sendMessage(m);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ - (void) run
self.debugObserver_(nil, [NSNumber numberWithInt:2]);

BOOL isInitialedForKeepAlive = (self.lastGetKeepAliveResponseFromServerTimstamp == 0);
if(code == 0 && self.lastGetKeepAliveResponseFromServerTimstamp == 0)
if(isInitialedForKeepAlive)
self.lastGetKeepAliveResponseFromServerTimstamp = [ToolKits getTimeStampWithMillisecond_l];

if(!isInitialedForKeepAlive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void run()
int code = LocalUDPDataSender.getInstance().sendKeepAlive();

boolean isInitialedForKeepAlive = (lastGetKeepAliveResponseFromServerTimstamp == 0);
if(code == 0 && lastGetKeepAliveResponseFromServerTimstamp == 0)
if(isInitialedForKeepAlive)
lastGetKeepAliveResponseFromServerTimstamp = System.currentTimeMillis();

if(!isInitialedForKeepAlive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,32 +104,8 @@ private void udpListeningImpl() throws Exception
DatagramSocket localUDPSocket = LocalUDPSocketProvider.getInstance().getLocalUDPSocket();
if (localUDPSocket != null && !localUDPSocket.isClosed())
{
/** ## Bug FIX 20190326 [Bug 1, Bug 2] - STAT
## [Bug 20190326_1 描述: 因socket未被释放,导致监听线程无法退出,从而导致OOM的发生]
## [Bug 20190326_2 描述: 因socket未被释放,导致虽手机网络物理连接正常(如WiFi),但不能宽带上网时,导致宽带恢上网后仍不能重连成功]*/
localUDPSocket.setSoTimeout(KeepAliveDaemon.NETWORK_CONNECTION_TIME_OUT + KeepAliveDaemon.KEEP_ALIVE_INTERVAL);
/** ## Bug FIX 20190326[1,2] - STAT */

try{
localUDPSocket.receive(packet);
messageHandler.handleMessage(packet);
}
catch(SocketTimeoutException e){
Log.i(TAG, "【IMCORE】【udpListeningImpl】localUDPSocket.receive() 抛出了异常" +
"SocketTimeoutException,应该是socket被close了,本次网络监听阻塞已被解除,socket" +
"监听线程也将正常结束生命周期。。。("+(thread == null ?"":thread.getId())+")");

/** ## Bug FIX 20190326 [Bug 2] - STAT */
try{
if(localUDPSocket != null) {
localUDPSocket.close();
localUDPSocket = null;
}
}catch(Exception ee){
Log.i(TAG, "【IMCORE】【udpListeningImpl】IN localUDPSocket.close(), cause="+ee.getMessage());
}
/** ## Bug FIX 20190326 [Bug 2] - END */
}
localUDPSocket.receive(packet);
messageHandler.handleMessage(packet);
}
}
}
Expand Down

0 comments on commit 4828778

Please sign in to comment.