update ip限制改为,同一ip可多个登录用户连接,游客只能存在一个。新增一个因为服务器宕机原因未删除游客聊天室和消息的定时任务

This commit is contained in:
yyb
2025-05-30 17:35:37 +08:00
parent 9904fbeb24
commit ffff88bacf
7 changed files with 93 additions and 27 deletions

View File

@@ -1,5 +1,10 @@
package com.m2pool.pool.utils;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
@@ -12,13 +17,23 @@ import java.net.UnknownHostException;
public class SocketDemo {
public static void main(String[] args) {
try {
//Socket socket = new Socket("10.168.2.167",21233);
Socket socket = new Socket("10.168.2.167",12973);
}catch (UnknownHostException e){
System.out.println("无法找到主机: "+e.getMessage());
} catch (IOException e) {
System.out.println("连接失败: " + e.getMessage());
}
//try {
// //Socket socket = new Socket("10.168.2.167",21233);
// Socket socket = new Socket("10.168.2.167",12973);
//}catch (UnknownHostException e){
// System.out.println("无法找到主机: "+e.getMessage());
//} catch (IOException e) {
// System.out.println("连接失败: " + e.getMessage());
//}
String url = "http://10.168.2.167:12973/blockflow/chain-info?fromGroup=0&toGroup=0";
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type","application/json");
headers.add("User-Agent", "Mozilla/5.0");
headers.add("apikey","0x09e220e226f2feb7a971a2b6f958e7d4b1c187c8");
HttpEntity<String> httpEntity = new HttpEntity<String>(null, headers);
String s = HttpUtil.get(url);
JSONObject jsonObject = JSONObject.parseObject(s);
int currentHeight = jsonObject.getIntValue("currentHeight");
}
}