Merge branch 'dev-cheney' into dev-1.0

# Conflicts:
#	pom.xml
#	src/main/java/com/sunyard/sge/database/SydApi4Database.java
#	src/main/java/com/sunyard/sge/database/SydApiBuilder.java
#	src/main/java/com/sunyard/sge/database/pool/SydApiPool.java
#	src/main/java/com/sunyard/sge/pool/ThreadBasedConnectPool.java
#	src/test/java/test/FuncTest.java
#	sydapi-database.iml
This commit is contained in:
cheney
2022-09-08 20:30:30 +08:00
25 changed files with 1790 additions and 758 deletions
+51
View File
@@ -0,0 +1,51 @@
package sample;
import com.sunyard.SydApi;
import racal.sunyard.main.SydApi4j;
import racal.sunyard.main.SydApiBuilder;
public class ConnectThread extends Thread {
public SydApi getApi() {
SydApiBuilder builder = new SydApiBuilder().setIp("172.16.18.59");
SydApi4j papi = (SydApi4j) builder.build();
// SydApi4j papi = (SydApi4j) new SydApi4j().connect("172.16.18.59" , 8889, null,1000);
return papi;
}
public static void main(String[] args) {
// logger.info("测试开始");
int n = Runtime.getRuntime().availableProcessors();
int max = 1001;
Thread[] tList = new Thread[max];
for (int i = 0; i < max; i++) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
System.out.println(Thread.currentThread().getName() + "已运行");
ConnectThread stable = new ConnectThread();
SydApi api = stable.getApi();
try {
// SydApi api = stable.getApi();
} catch (Exception e) {
e.printStackTrace();
}
}
});
tList[i] = thread;
}
for (Thread t : tList) {
t.start();
}
for (Thread t : tList) {
try {
t.join();
} catch (InterruptedException e3) {
e3.printStackTrace();
}
}
}
}
+4 -1
View File
@@ -10,10 +10,13 @@ public class ShortLinkSample {
// 路径要以 / 或 \\ 结尾表示目录
String[] pcipList = {"127.0.0.1", "192.168.0.200" };
int[] iportList ={8080,8889};
int[] iportList = {8080,8889};
SydApi api = new SydApi4Database();
try {
api.SYD_Short_Connect_Ex(pcipList,iportList,10,10);
} finally {
if ( null != api ) {
api.SYD_Disconnect_Ex();