mirror of
https://gitee.com/farsunset/cim.git
synced 2025-06-17 07:35:25 +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.InetSocketAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.ClosedSelectorException;
|
||||
import java.nio.channels.SelectionKey;
|
||||
import java.nio.channels.Selector;
|
||||
import java.nio.channels.SocketChannel;
|
||||
@ -197,12 +196,14 @@ class CIMConnectorManager{
|
||||
}
|
||||
|
||||
}catch(ConnectException ignore){
|
||||
IOLOCK.unlock();
|
||||
handleConnectAbortedEvent();
|
||||
}catch(IllegalArgumentException ignore){
|
||||
IOLOCK.unlock();
|
||||
handleConnectAbortedEvent();
|
||||
}catch(IOException ignore) {
|
||||
handelDisconnectedEvent();
|
||||
}catch(ClosedSelectorException ignore) {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -407,11 +408,10 @@ class CIMConnectorManager{
|
||||
}
|
||||
}
|
||||
|
||||
if(result == -1) {
|
||||
closeSession();
|
||||
return;
|
||||
}
|
||||
|
||||
if(result == -1 && !readBuffer.hasRemaining()) {
|
||||
closeSession();
|
||||
return;
|
||||
}
|
||||
|
||||
markLastReadTime();
|
||||
|
||||
@ -436,6 +436,11 @@ class CIMConnectorManager{
|
||||
}
|
||||
|
||||
this.messageReceived(message);
|
||||
|
||||
if(result == -1) {
|
||||
closeSession();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class CIMLogger {
|
||||
|
||||
try {
|
||||
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) {
|
||||
}
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user