mirror of
https://gitee.com/farsunset/cim.git
synced 2025-06-30 14:14:50 +08:00
修改在android sdk 在低版本中一个兼容问题
This commit is contained in:
parent
18e7464051
commit
42ade1ada8
@ -25,7 +25,6 @@ import java.io.IOException;
|
|||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.ClosedSelectorException;
|
|
||||||
import java.nio.channels.SelectionKey;
|
import java.nio.channels.SelectionKey;
|
||||||
import java.nio.channels.Selector;
|
import java.nio.channels.Selector;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
@ -197,12 +196,14 @@ class CIMConnectorManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}catch(ConnectException ignore){
|
}catch(ConnectException ignore){
|
||||||
|
IOLOCK.unlock();
|
||||||
handleConnectAbortedEvent();
|
handleConnectAbortedEvent();
|
||||||
}catch(IllegalArgumentException ignore){
|
}catch(IllegalArgumentException ignore){
|
||||||
|
IOLOCK.unlock();
|
||||||
handleConnectAbortedEvent();
|
handleConnectAbortedEvent();
|
||||||
}catch(IOException ignore) {
|
}catch(IOException ignore) {
|
||||||
handelDisconnectedEvent();
|
handelDisconnectedEvent();
|
||||||
}catch(ClosedSelectorException ignore) {}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -407,11 +408,10 @@ class CIMConnectorManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result == -1) {
|
if(result == -1 && !readBuffer.hasRemaining()) {
|
||||||
closeSession();
|
closeSession();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
markLastReadTime();
|
markLastReadTime();
|
||||||
|
|
||||||
@ -436,6 +436,11 @@ class CIMConnectorManager{
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.messageReceived(message);
|
this.messageReceived(message);
|
||||||
|
|
||||||
|
if(result == -1) {
|
||||||
|
closeSession();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class CIMLogger {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (session.socket().getLocalAddress() != null) {
|
if (session.socket().getLocalAddress() != null) {
|
||||||
builder.append(" L:").append(session.socket().getLocalAddress().toString());
|
builder.append(" L:").append(session.socket().getLocalAddress()+":"+session.socket().getLocalPort());
|
||||||
}
|
}
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user