check修改

This commit is contained in:
junj2.liang 2022-08-15 16:33:46 +08:00
parent 9fbebac1ea
commit 5518ffc457
2 changed files with 18 additions and 9 deletions

View File

@ -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();

View File

@ -55,12 +55,14 @@ public class SydApiPool extends ThreadBasedConnectPool<SydApi> {
}
// 保活接口
protected boolean check(SydApi 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) {