📄 app_telmain.java
字号:
package telproject;
import java.io.*;
import java.net.*;
/**
* <p>
* Title:
* </p>
* <p>
* Description:
* </p>
* <p>
* Copyright: Copyright (c) 2006
* </p>
* <p>
* Company:
* </p>
*
* @author not attributable
* @version 1.0
*/
public class App_TelMain {
private final int queue_Max = 10;
private Pub_RunMonitor monitor;
private Pub_MyRunnable[] thread;
private Queue_Socket[] socket_queue;
private App_ServerThread serverthread = null;
public App_TelMain() {
thread = new Pub_MyRunnable[100];
int i = 0;
socket_queue = new Queue_Socket[queue_Max];
System.out.println("--初始化端口和IP...");
new Pub_ReadXML();
System.out.println(" 家校通IP: " + Pub_ReadXML.smSchoolServerIP);
System.out.println(" 家校通端口: " + Pub_ReadXML.smSchoolServerPort);
System.out.println(" 程序监听端口: " + Pub_ReadXML.monitorPort);
// 启动客户端处理线程
for (int j = 0; j < 10; j++) {
socket_queue[j] = new Queue_Socket();
thread[i++] = new App_ClientThread(j, socket_queue[j]);
}
// 启动服务端主线程
serverthread = new App_ServerThread(socket_queue);
thread[i++] = serverthread;
System.out.println("--[系统模块]当前启动系统线程总数=" + i);
}
public void run() {
monitor = new Pub_RunMonitor(thread);
monitor.start();
}
public static void main(String[] args) throws IOException {
(new App_TelMain()).run();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -