check修改
This commit is contained in:
parent
9fbebac1ea
commit
5518ffc457
@ -30,6 +30,10 @@ public class SydApi4Database implements SydApi {
|
||||
this.hsms = hsms;
|
||||
}
|
||||
|
||||
public SydApi4j[] getHsms() {
|
||||
return hsms;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SydApi SYD_Short_Connect_Ex(String[] pcIpList, int[] iPortList, int iConnectTimeOut, int allDealTimeOut) {
|
||||
Logger log = LogFactory.getLogger();
|
||||
|
||||
@ -55,12 +55,14 @@ public class SydApiPool extends ThreadBasedConnectPool<SydApi> {
|
||||
}
|
||||
|
||||
// 保活接口
|
||||
protected boolean check(SydApi o) {
|
||||
if ( null == o ) {
|
||||
protected boolean check(SydApi4Database o) {
|
||||
if (null==o) {
|
||||
return false;
|
||||
}
|
||||
SydApi4j[] hsms = o.getHsms();
|
||||
for (SydApi4j hsm : hsms) {
|
||||
if ( null != hsm ) {
|
||||
try {
|
||||
|
||||
o.SYD_SM3_Hash_ShortData( new byte[8] );
|
||||
return true;
|
||||
|
||||
@ -69,6 +71,9 @@ public class SydApiPool extends ThreadBasedConnectPool<SydApi> {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 释放
|
||||
protected void free(SydApi o) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user