2024-05-13 14:41:54 +08:00
|
|
|
package org.aohe;
|
|
|
|
|
2024-05-14 15:12:21 +08:00
|
|
|
import java.io.IOException;
|
2024-05-15 20:24:05 +08:00
|
|
|
import java.net.UnknownHostException;
|
2024-05-14 15:12:21 +08:00
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2024-05-15 20:24:05 +08:00
|
|
|
import org.aohe.core.utils.CommandUtils;
|
2024-05-14 15:12:21 +08:00
|
|
|
import org.aohe.core.utils.SystemUtils;
|
2024-05-15 20:24:05 +08:00
|
|
|
import org.aohe.core.web.SocketServer;
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.InputStreamReader;
|
2024-05-14 15:12:21 +08:00
|
|
|
|
|
|
|
@Slf4j
|
2024-05-13 14:41:54 +08:00
|
|
|
public class Main {
|
2024-05-15 20:24:05 +08:00
|
|
|
public static void main(String[] args) throws IOException, InterruptedException {
|
2024-05-14 15:12:21 +08:00
|
|
|
log.info(" 当前系统类型: {}", SystemUtils.getOsName());
|
2024-05-15 20:24:05 +08:00
|
|
|
//初始化Sane Socket 守护进程
|
|
|
|
CommandUtils.initSanedSocket();
|
|
|
|
int port = 8997; // 843 flash policy port
|
2024-05-14 15:12:21 +08:00
|
|
|
|
2024-05-15 20:24:05 +08:00
|
|
|
SocketServer s = new SocketServer(port);
|
|
|
|
s.start();
|
|
|
|
System.out.println("scan-service started on port: " + s.getPort());
|
2024-05-14 15:12:21 +08:00
|
|
|
|
2024-05-15 20:24:05 +08:00
|
|
|
BufferedReader sysin = new BufferedReader(new InputStreamReader(System.in));
|
|
|
|
while (true) {
|
|
|
|
String in = sysin.readLine();
|
|
|
|
s.broadcast(in);
|
|
|
|
if (in.equals("exit")) {
|
|
|
|
s.stop(1000);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2024-05-13 14:41:54 +08:00
|
|
|
}
|
|
|
|
}
|