We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
场景复现: 1、服务端,每秒钟推送一次 public static void main(String[] args)throws Exception{ HproseTcpServer server=new HproseTcpServer("tcp://127.0.0.1:4321"); server.publish("time",12000,3000); server.start(); Timer timer=new Timer(); timer.schedule(new TimerTask() { @OverRide public void run() { System.out.println(LocalDateTime.now()+" "+ JSON.toJSONString(server.idlist("time") )+" "+ LocalTime.now().getSecond()); server.unicast("time","test",LocalTime.now().getSecond()); } },0,1000); } 2、客户端订阅接收 public static void main(String[] args) throws Exception{ //订阅服务 HproseClient client=HproseClient.create("tcp://127.0.0.1:4321");
Thread thread=new Thread(new Runnable() { @Override public void run() { client.subscribe("time","test",(String msg)->{ System.out.println(LocalDateTime.now()+" "+msg ); },String.class); } }); thread.start(); }
现象:服务端看到订阅的客户端掉线
客户端接收日志
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
java 版本的不完善,像 golang、dotnet、typescript 这些都已经升级到 3.0 了,3.0 的推送已经很完善了。但是 java 语言本身太不思进取了,实在没精力把 java 版本的也升级到 3.0。等什么时候 java 支持 async/await 之后再看看吧。
No branches or pull requests
场景复现:
1、服务端,每秒钟推送一次
public static void main(String[] args)throws Exception{
HproseTcpServer server=new HproseTcpServer("tcp://127.0.0.1:4321");
server.publish("time",12000,3000);
server.start();
Timer timer=new Timer();
timer.schedule(new TimerTask() {
@OverRide
public void run() {
System.out.println(LocalDateTime.now()+" "+ JSON.toJSONString(server.idlist("time") )+" "+ LocalTime.now().getSecond());
server.unicast("time","test",LocalTime.now().getSecond());
}
},0,1000);
}
2、客户端订阅接收
public static void main(String[] args) throws Exception{
//订阅服务
HproseClient client=HproseClient.create("tcp://127.0.0.1:4321");
现象:服务端看到订阅的客户端掉线
客户端接收日志
The text was updated successfully, but these errors were encountered: